Commit 271e07b4 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Add begin of preset widget

* Make KisPaintOpSettings and KisPaintOpPreset shared pointers
* Rename the resource server classes to something more distinct
* Load presets in the resource server


svn path=/trunk/koffice/; revision=790973
parent 727bf145
......@@ -40,7 +40,7 @@ Regressions from 1.x
* Curve Paint is replaced by a flake-based curve tool, but that
is not finished yet.
* Perspective Transform Tool has not been ported yet
* Brush outline has been lost
* Brush outline cursor mode has been lost
* select brush and eraser don't work (they should be either the
vector-based flake tools for the vector selection or the ordinary
paint tools for the raster selection)
......
......@@ -1442,6 +1442,7 @@ KisBrush* KisBrush::clone() const {
void KisBrush::toXML(QDomDocument& d, QDomElement& e) const
{
Q_UNUSED(d);
e.setAttribute( "type", "brush" );
e.setAttribute("name", name());
e.setAttribute("filename", filename());
......
......@@ -38,7 +38,7 @@
#include "kis_global.h"
#include "kis_iterators_pixel.h"
#include "kis_datamanager.h"
#include "kis_paintop_settings.h"
#define BEZIER_FLATNESS_THRESHOLD 0.5
#define MAXIMUM_SCALE 2
......@@ -260,13 +260,14 @@ bool KisPaintOpFactory::userVisible(const KoColorSpace * cs )
}
KisPaintOpSettings* KisPaintOpFactory::settings(QWidget* /*parent*/, const KoInputDevice& /*inputDevice*/, KisImageSP /*image*/)
KisPaintOpSettingsSP KisPaintOpFactory::settings(QWidget* /*parent*/, const KoInputDevice& /*inputDevice*/, KisImageSP /*image*/)
{
return 0;
}
KisPaintOpSettings* KisPaintOpFactory::settings(KisImageSP image)
KisPaintOpSettingsSP KisPaintOpFactory::settings(KisImageSP image)
{
Q_UNUSED(image);
return 0;
}
......
......@@ -25,6 +25,7 @@
#include "kis_shared.h"
#include "kis_types.h"
#include "kis_paintop_settings.h"
#include <krita_export.h>
......@@ -38,7 +39,7 @@ class KoPointerEvent;
class KisQImagemask;
class KisPainter;
class KisPaintInformation;
class KisPaintOpSettings;
/**
* KisPaintOp are use by tools to draw on a paint device.
*/
......@@ -136,7 +137,7 @@ public:
* @param settings the settings associated with the input device
* @param painter the painter used to draw
*/
virtual KisPaintOp * createOp(const KisPaintOpSettings *settings, KisPainter * painter, KisImageSP image) = 0;
virtual KisPaintOp * createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image) = 0;
virtual QString id() const = 0;
virtual QString name() const = 0;
......@@ -157,8 +158,8 @@ public:
* specified input device. Return 0 if there are no settings available for the given
* device.
*/
virtual KisPaintOpSettings* settings(QWidget* parent, const KoInputDevice& inputDevice, KisImageSP image);
virtual KisPaintOpSettings* settings(KisImageSP image);
virtual KisPaintOpSettingsSP settings(QWidget* parent, const KoInputDevice& inputDevice, KisImageSP image);
virtual KisPaintOpSettingsSP settings(KisImageSP image);
};
#endif // KIS_PAINTOP_H_
......@@ -32,7 +32,7 @@
#include "kis_image.h"
struct KisPaintOpPreset::Private {
KisPaintOpSettings settings;
KisPaintOpSettingsSP settings;
QImage img;
};
......@@ -54,6 +54,16 @@ KisPaintOpPreset::~KisPaintOpPreset()
delete m_d;
}
KoID KisPaintOpPreset::paintOp()
{
return KoID(m_d->settings->getString("paintop"), name());
}
KisPaintOpSettingsSP KisPaintOpPreset::settings()
{
return m_d->settings;
}
bool KisPaintOpPreset::load()
{
if (filename().isEmpty())
......@@ -61,11 +71,11 @@ bool KisPaintOpPreset::load()
QFile f(filename());
f.open(QIODevice::ReadOnly);
m_d->settings.fromXML(QString(f.readAll()));
m_d->settings->fromXML(QString(f.readAll()));
f.close();
return true;
setName(m_d->settings.getString("name"));
setName(m_d->settings->getString("name"));
}
bool KisPaintOpPreset::save()
......@@ -75,7 +85,7 @@ bool KisPaintOpPreset::save()
QFile f(filename());
f.open( QIODevice::WriteOnly );
f.write( m_d->settings.toXML().toUtf8() );
f.write( m_d->settings->toXML().toUtf8() );
f.close();
return true;
}
......@@ -87,12 +97,12 @@ QImage KisPaintOpPreset::img() const
void KisPaintOpPreset::updateImg()
{
Q_ASSERT(!m_d->settings.getString("paintop").isNull());
Q_ASSERT(!m_d->settings->getString("paintop").isNull());
KisPaintDeviceSP dev = new KisPaintDevice(KoColorSpaceRegistry::instance()->rgb8(), "paintop_preset");
KisPainter gc(dev);
KisPaintOp * op = KisPaintOpRegistry::instance()->paintOp(m_d->settings.getString("paintop"),
&m_d->settings, &gc);
KisPaintOp * op = KisPaintOpRegistry::instance()->paintOp(m_d->settings->getString("paintop"),
m_d->settings, &gc);
}
......@@ -20,10 +20,16 @@
#define KIS_PAINTOP_PRESET_H
#include "KoResource.h"
#include "KoID.h"
#include "kis_shared.h"
#include "kis_paintop_settings.h"
#include "krita_export.h"
class QImage;
class KisPaintOpPreset;
typedef KisSharedPtr<KisPaintOpPreset> KisPaintOpPresetSP;
/**
* A KisPaintOpPreset records a particular set of settings
......@@ -31,7 +37,7 @@ class QImage;
* in that though the latter contains much the same information, it
* also contains state information that should be kept between strokes.
*/
class KRITAIMAGE_EXPORT KisPaintOpPreset : public KoResource
class KRITAIMAGE_EXPORT KisPaintOpPreset : public KoResource, public KisShared
{
public:
......@@ -41,6 +47,12 @@ public:
~KisPaintOpPreset();
/// return the id of the paintop plugin
KoID paintOp();
/// return the settings that define this paintop preset
KisPaintOpSettingsSP settings();
bool load();
bool save();
......
......@@ -66,30 +66,29 @@ KisPaintOpRegistry* KisPaintOpRegistry::instance()
return KisPaintOpRegistry::m_singleton;
}
KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSettings * settings, KisPainter * painter, KisImageSP image) const
KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image) const
{
if (painter == 0) {
kWarning() <<" KisPaintOpRegistry::paintOp painter is null";
return 0;
}
#if 0
if (settings == 0) {
kWarning() << "KisPaintOpSettings is null";
return 0;
}
#endif
if ( !painter->bounds().isValid() && image )
painter->setBounds( image->bounds() );
KisPaintOpFactorySP f = value(id);
if (f)
if (f) {
return f->createOp(settings, painter, image);
}
return 0;
}
KisPaintOp * KisPaintOpRegistry::paintOp(const KisPaintOpPresetSP preset, KisPainter * painter, KisImageSP image) const
{
return 0;
}
KisPaintOpSettings * KisPaintOpRegistry::settings(const KoID& id, QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image) const
KisPaintOpSettingsSP KisPaintOpRegistry::settings(const KoID& id, QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image) const
{
KisPaintOpFactorySP f = value(id.id());
if (f)
......
......@@ -21,15 +21,18 @@
#include <QObject>
#include "KoGenericRegistry.h"
#include "kis_paintop.h"
#include "kis_types.h"
#include "KoGenericRegistry.h"
#include "kis_paintop_settings.h"
#include "kis_paintop_preset.h"
#include <krita_export.h>
class QWidget;
class KisPaintOp;
class KisPaintOpSettings;
class KisPainter;
class KoColorSpace;
class KoInputDevice;
......@@ -45,14 +48,14 @@ public:
/**
* Return a newly created paintop. You are responsible for deletin
*/
KisPaintOp * paintOp(const QString& id, const KisPaintOpSettings * settings, KisPainter * painter, KisImageSP image = 0) const;
KisPaintOp * paintOp(const QString& id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image = 0) const;
/**
* Create and return a paintop based on the given preset. A preset defines
* a paintop, a settings object and possible a brush tip.
*/
//KisPaintOp * paintOp(const KisPaintOpPreset * preset, KisPainter * painter, KisImageSP image) const;
KisPaintOp * paintOp(const KisPaintOpPresetSP preset, KisPainter * painter, KisImageSP image) const;
/**
* Create and return an (abstracted) configuration widget
......@@ -60,7 +63,7 @@ public:
* with the specified parent as widget parent. Returns 0 if there
* are no settings available for the given device.
*/
KisPaintOpSettings * settings(const KoID& id, QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image = 0) const;
KisPaintOpSettingsSP settings(const KoID& id, QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image = 0) const;
// Whether we should show this paintop in the toolchest
bool userVisible(const KoID & id, const KoColorSpace* cs) const;
......
......@@ -55,8 +55,9 @@ void KDE_DEPRECATED KisPaintOpSettings::setNode(KisNodeSP node )
d->node = node;
}
KisPaintOpSettings* KisPaintOpSettings::clone() const
KisPaintOpSettingsSP KisPaintOpSettings::clone() const
{
KisPaintOpSettings * c = new KisPaintOpSettings();
c->fromXML(toXML());
return c;
}
......@@ -22,11 +22,15 @@
#include "kis_types.h"
#include "krita_export.h"
#include "kis_shared.h"
#include "kis_properties_configuration.h"
class QWidget;
class KoPointerEvent;
class KisPaintOpSettings;
typedef KisSharedPtr<KisPaintOpSettings> KisPaintOpSettingsSP;
/**
* This class is used to cache the settings (and the associated widget) for a paintop
* between two creations. There is one KisPaintOpSettings per input device (mouse, tablet,
......@@ -36,7 +40,7 @@ class KoPointerEvent;
* paintop's settings subclass has data that is not stored as a property, that data is not
* saved and restored.
*/
class KRITAIMAGE_EXPORT KisPaintOpSettings : public KisPropertiesConfiguration {
class KRITAIMAGE_EXPORT KisPaintOpSettings : public KisPropertiesConfiguration, public KisShared {
public:
KisPaintOpSettings();
......@@ -54,7 +58,7 @@ public:
* Clone the current settings object. Override this if your settings instance doesn't
* store everything as properties.
*/
virtual KisPaintOpSettings* clone() const;
virtual KisPaintOpSettingsSP clone() const;
/**
* Override this function if your paintop is interested in which
......
......@@ -163,8 +163,6 @@ typedef KisSharedPtrVector<KisAnnotation> vKisAnnotationSP;
typedef vKisAnnotationSP::iterator vKisAnnotationSP_it;
typedef vKisAnnotationSP::const_iterator vKisAnnotationSP_cit;
// #include <kis_iterators_pixel.h>
template<class T, typename TSelect> class KisLineIteratorPixelBase;
class KisHLineConstIterator;
......
......@@ -170,9 +170,9 @@
<Action name="brushes"/>
<Action name="gradients"/>
<Action name="patterns"/>
<Action name="dual"/>
<Separator/>
<Action name="paintops"/>
<Action name="dual"/>
<Action name="paintop_options"/>
</ToolBar>
......
......@@ -38,7 +38,7 @@
#include "kis_imagepipe_brush.h"
#include "kis_custom_brush.h"
#include "kis_resource_mediator.h"
#include "kis_resourceserverprovider.h"
#include "kis_resource_server_provider.h"
#include "kis_paint_layer.h"
#include "kis_group_layer.h"
......
......@@ -41,7 +41,7 @@ void KisComplexOp::paintAt(const KisPaintInformation &info)
}
KisPaintOp *KisComplexOpFactory::createOp(const KisPaintOpSettings *settings, KisPainter *painter, KisImageSP image)
KisPaintOp *KisComplexOpFactory::createOp(const KisPaintOpSettingsSP settings, KisPainter *painter, KisImageSP image)
{
Q_UNUSED(settings)
Q_UNUSED(image)
......
......@@ -20,10 +20,10 @@
#define KIS_COMPLEXOP_H_
#include <kis_paintop.h>
#include <kis_paintop_settings.h>
class KisPainter;
class KisPaintInformation;
class KisPaintOpSettings;
class QString;
class KisComplexOp : public KisPaintOp {
......@@ -47,7 +47,7 @@ class KisComplexOpFactory : public KisPaintOpFactory {
KisComplexOpFactory() {}
~KisComplexOpFactory() {}
KisPaintOp *createOp(const KisPaintOpSettings *settings, KisPainter *painter, KisImageSP image);
KisPaintOp *createOp(const KisPaintOpSettingsSP settings, KisPainter *painter, KisImageSP image);
QString id() const;
QString name() const;
......
......@@ -26,7 +26,7 @@
#include "mixertool.h"
#include <kis_paintop.h>
#include <kis_resource_provider.h>
#include <kis_canvas_resource_provider.h>
#include <kis_view2.h>
#include <KoColorSpace.h>
#include <KoToolProxy.h>
......
......@@ -25,7 +25,7 @@
class QButtonGroup;
class KisPaintOp;
class KisResourceProvider;
class KisCanvasResourceProvider;
class KisView2;
class KoColor;
class KoColorSpace;
......@@ -57,7 +57,7 @@ private:
QButtonGroup *m_bgColors;
QList<KoColor> m_vColors;
KisResourceProvider *m_resources;
KisCanvasResourceProvider *m_resources;
const KoColorSpace *m_colorspace;
};
......
......@@ -26,7 +26,7 @@
#include <kis_painterly_overlay.h>
#include <kis_paint_layer.h>
#include <kis_paintop_registry.h>
#include <kis_resource_provider.h>
#include <kis_canvas_resource_provider.h>
#include <KoCanvasResourceProvider.h>
#include <KoColorSpace.h>
#include <KoShapeManager.h>
......@@ -86,19 +86,19 @@ KoUnit MixerCanvas::unit() const
return KoUnit();
}
void MixerCanvas::setResources(KisResourceProvider *rp)
void MixerCanvas::setResources(KisCanvasResourceProvider *rp)
{
KoCanvasResourceProvider *internal = resourceProvider();
internal->setResource(KoCanvasResource::ForegroundColor, rp->fgColor());
internal->setResource(KoCanvasResource::BackgroundColor, rp->bgColor());
internal->setResource(KisResourceProvider::CurrentBrush, rp->currentBrush());
internal->setResource(KisResourceProvider::CurrentPattern, rp->currentPattern());
internal->setResource(KisResourceProvider::CurrentGradient, rp->currentGradient());
internal->setResource(KisCanvasResourceProvider::CurrentBrush, rp->currentBrush());
internal->setResource(KisCanvasResourceProvider::CurrentPattern, rp->currentPattern());
internal->setResource(KisCanvasResourceProvider::CurrentGradient, rp->currentGradient());
internal->setResource(KisResourceProvider::CurrentKritaLayer, rp->currentLayer().data());
internal->setResource(KisResourceProvider::HdrExposure, rp->HDRExposure());
internal->setResource(KisResourceProvider::CurrentPaintop, rp->currentPaintop());
internal->setResource(KisCanvasResourceProvider::CurrentKritaLayer, rp->currentLayer().data());
internal->setResource(KisCanvasResourceProvider::HdrExposure, rp->HDRExposure());
internal->setResource(KisCanvasResourceProvider::CurrentPaintop, rp->currentPaintop());
initPaintopSettings(); // TODO ?
checkCurrentPaintop();
......@@ -118,25 +118,25 @@ void MixerCanvas::checkCurrentPaintop()
KisPainter painter(device());
KisPaintOp *current = KisPaintOpRegistry::instance()->paintOp(
internal->resource(KisResourceProvider::CurrentPaintop).value<KoID>().id(),
internal->resource(KisCanvasResourceProvider::CurrentPaintop).value<KoID>().id(),
static_cast<KisPaintOpSettings*>(
internal->resource(KisResourceProvider::CurrentPaintopSettings).value<void *>()),
internal->resource(KisCanvasResourceProvider::CurrentPaintopSettings).value<void *>()),
&painter, 0);
painter.setPaintOp(current); // This is done just for the painter to own the paintop and destroy it
if (current && !current->painterly())
internal->setResource(KisResourceProvider::CurrentPaintop, KoID("paintcomplex", ""));
internal->setResource(KisCanvasResourceProvider::CurrentPaintop, KoID("paintcomplex", ""));
}
void MixerCanvas::checkCurrentLayer()
{
KoCanvasResourceProvider *internal = resourceProvider();
KisLayerSP current = internal->resource(KisResourceProvider::CurrentKritaLayer).value<KisLayerSP>();
KisLayerSP current = internal->resource(KisCanvasResourceProvider::CurrentKritaLayer).value<KisLayerSP>();
if (current.data() != m_layer.data()) {
QVariant v;
v.setValue(KisLayerSP(m_layer.data()));
internal->setResource(KisResourceProvider::CurrentKritaLayer, v);
internal->setResource(KisCanvasResourceProvider::CurrentKritaLayer, v);
}
}
......@@ -223,16 +223,16 @@ void MixerCanvas::slotClear()
void MixerCanvas::slotResourceChanged(int key, const QVariant &value)
{
if (key != KisResourceProvider::CurrentPaintopSettings)
if (key != KisCanvasResourceProvider::CurrentPaintopSettings)
resourceProvider()->setResource(key, value);
else
return;
switch (key) {
case KisResourceProvider::CurrentPaintop:
case KisCanvasResourceProvider::CurrentPaintop:
checkCurrentPaintop();
break;
case KisResourceProvider::CurrentKritaLayer:
case KisCanvasResourceProvider::CurrentKritaLayer:
checkCurrentLayer();
break;
}
......
......@@ -27,7 +27,7 @@
class KisPaintDevice;
class KisPainterlyOverlay;
class KisResourceProvider;
class KisCanvasResourceProvider;
class KoColorSpace;
class KoShapeManager;
class KoToolProxy;
......@@ -48,7 +48,7 @@ public:
MixerCanvas(QWidget *parent);
~MixerCanvas();
void setResources(KisResourceProvider *rp);
void setResources(KisCanvasResourceProvider *rp);
void setLayer(const KoColorSpace *cs);
KisPaintLayer *layer();
......
......@@ -24,13 +24,13 @@
#include <kis_painter.h>
#include <kis_paintop_registry.h>
#include <kis_resource_provider.h>
#include <kis_canvas_resource_provider.h>
#include <KoPointerEvent.h>
#include <QCursor>
#include <QRegion>
#include <QString>
MixerTool::MixerTool(MixerCanvas *mixer, KisResourceProvider *rp)
MixerTool::MixerTool(MixerCanvas *mixer, KisCanvasResourceProvider *rp)
: KisToolFreehand(mixer, QCursor(), "Mixer Wrapper Tool"), m_mixer(mixer), m_resources(rp)
{
activate();
......
......@@ -23,7 +23,7 @@
#include "kis_tool_freehand.h"
class KisResourceProvider;
class KisCanvasResourceProvider;
class KoPointerEvent;
class MixerCanvas;
class QRegion;
......@@ -32,7 +32,7 @@ class MixerTool : public KisToolFreehand {
Q_OBJECT
public:
MixerTool(MixerCanvas *mixer, KisResourceProvider *rp);
MixerTool(MixerCanvas *mixer, KisCanvasResourceProvider *rp);
~MixerTool();
public:
......@@ -43,7 +43,7 @@ protected:
void endPaint();
MixerCanvas *m_mixer;
KisResourceProvider *m_resources;
KisCanvasResourceProvider *m_resources;
};
......
......@@ -64,7 +64,7 @@ KisCPaintOpFactory::~KisCPaintOpFactory()
*/
}
KisPaintOp * KisCPaintOpFactory::createOp(const KisPaintOpSettings *settings,
KisPaintOp * KisCPaintOpFactory::createOp(const KisPaintOpSettingsSP settings,
KisPainter * painter,
KisImageSP image)
{
......@@ -72,7 +72,7 @@ KisPaintOp * KisCPaintOpFactory::createOp(const KisPaintOpSettings *settings,
dbgKrita << settings;
const KisCPaintOpSettings * cpaintOpSettings =
dynamic_cast<const KisCPaintOpSettings*>( settings );
dynamic_cast<const KisCPaintOpSettings*>( settings.data() );
Q_ASSERT( cpaintOpSettings );
if ( !cpaintOpSettings ) return 0;
......@@ -91,14 +91,14 @@ KisPaintOp * KisCPaintOpFactory::createOp(const KisPaintOpSettings *settings,
return op;
}
KisPaintOpSettings *KisCPaintOpFactory::settings(QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image)
KisPaintOpSettingsSP KisCPaintOpFactory::settings(QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image)
{
Q_UNUSED( inputDevice );
Q_UNUSED( image );
return new KisCPaintOpSettings( parent, m_brushes);
}
KisPaintOpSettings *KisCPaintOpFactory::settings(KisImageSP image)
KisPaintOpSettingsSP KisCPaintOpFactory::settings(KisImageSP image)
{
Q_UNUSED( image );
return new KisCPaintOpSettings( 0, m_brushes);
......@@ -124,7 +124,7 @@ KisCPaintOpSettings::KisCPaintOpSettings( QWidget * parent, Q3ValueVector<Brush
connect( m_options->bnInk, SIGNAL( clicked() ), this, SLOT( resetCurrentBrush() ) );
}
KisPaintOpSettings* KisCPaintOpSettings::clone() const
KisPaintOpSettingsSP KisCPaintOpSettings::clone() const
{
KisCPaintOpSettings* s = new KisCPaintOpSettings(0, m_brushes);
s->m_options->intInk->setValue( ink() );
......@@ -186,7 +186,9 @@ KisCPaintOp::KisCPaintOp(Brush * brush, const KisCPaintOpSettings * settings, Ki
KisCPaintOp::~KisCPaintOp()
{
delete m_stroke;
}void KisCPaintOp::paintAt(const KisPaintInformation& info)
}
void KisCPaintOp::paintAt(const KisPaintInformation& info)
{
if (!painter()->device()) return;
......
......@@ -40,11 +40,11 @@ public:
KisCPaintOpFactory();
virtual ~KisCPaintOpFactory();
virtual KisPaintOp * createOp(const KisPaintOpSettings *settings, KisPainter * painter, KisImageSP image);
virtual KisPaintOp * createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image);
virtual QString id() const { return "paintCPaint"; }
virtual QString name() const { return i18n("Chinese Brush"); }
virtual KisPaintOpSettings *settings(QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image);
virtual KisPaintOpSettings *settings(KisImageSP image);
virtual KisPaintOpSettingsSP settings(QWidget * parent, const KoInputDevice& inputDevice, KisImageSP image);
virtual KisPaintOpSettingsSP settings(KisImageSP image);
private:
......@@ -61,7 +61,7 @@ public:
KisCPaintOpSettings(QWidget * parent, Q3ValueVector<Brush*> m_brushes);
virtual ~KisCPaintOpSettings() {}
virtual KisPaintOpSettings* clone() const;
virtual KisPaintOpSettingsSP clone() const;
int brush() const;
int ink() const;
......
......@@ -10,7 +10,7 @@ set(kritadefaultpaintops_PART_SRCS
# kis_smudgeop.cc
)
kde4_add_ui_files(kritadefaultpaintops_PART_SRCS kis_dlgbrushcurvecontrol.ui DuplicateOpOptionsWidget.ui )
kde4_add_ui_files(kritadefaultpaintops_PART_SRCS wdgbrushcurves.ui wdgduplicateop.ui )
kde4_add_plugin(kritadefaultpaintops ${kritadefaultpaintops_PART_SRCS})
......
......@@ -38,8 +38,9 @@
#include "kis_datamanager.h"
KisPaintOp * KisAirbrushOpFactory::createOp(const KisPaintOpSettings */*settings*/, KisPainter * painter, KisImageSP image)
KisPaintOp * KisAirbrushOpFactory::createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image)
{
Q_UNUSED( settings );
Q_UNUSED( image );
KisPaintOp * op = new KisAirbrushOp(painter);
Q_CHECK_PTR(op);
......
......@@ -35,7 +35,7 @@ public:
KisAirbrushOpFactory() {}
virtual ~KisAirbrushOpFactory() {}
virtual KisPaintOp * createOp(const KisPaintOpSettings *settings, KisPainter * painter, KisImageSP image);
virtual KisPaintOp * createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image);
virtual QString id() const { return "airbrush"; }
virtual QString name() const { return i18n("Pixel Airbrush"); }
virtual QString pixmap() { return "krita-airbrush.png"; }
......
......@@ -50,13 +50,16 @@
#include <kis_properties_configuration.h>
#include <kis_selection.h>
#include "ui_kis_dlgbrushcurvecontrol.h"
#include "ui_wdgbrushcurves.h"
KisPaintOp * KisBrushOpFactory::createOp(const KisPaintOpSettings *settings,
KisPaintOp * KisBrushOpFactory::createOp(const KisPaintOpSettingsSP settings,
KisPainter * painter, KisImageSP image)
{
Q_UNUSED( image );
const KisBrushOpSettings *brushopSettings = dynamic_cast<const KisBrushOpSettings *>(settings);
qDebug() << "creating brushop";
const KisBrushOpSettings *brushopSettings = dynamic_cast<const KisBrushOpSettings *>(settings.data());
Q_ASSERT(settings == 0 || brushopSettings != 0);
KisPaintOp * op = new KisBrushOp(brushopSettings, painter);
......@@ -72,9 +75,6 @@ KisBrushOpSettings::KisBrushOpSettings(QWidget *parent)
QHBoxLayout * l = new QHBoxLayout(m_optionsWidget);