Commit aa9855b1 authored by Boudewijn Rempt's avatar Boudewijn Rempt

There is only one owner of KisImage and that is KisDoc

So use WSP instead of SP, except in KisDoc.

svn path=/trunk/koffice/; revision=1029352
parent 13de7d97
......@@ -50,7 +50,7 @@ public:
* @param settings the settings associated with the input device
* @param painter the painter used to draw
*/
virtual KisPaintOp * createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image) = 0;
virtual KisPaintOp * createOp(const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageWSP image) = 0;
virtual QString id() const = 0;
virtual QString name() const = 0;
......@@ -70,8 +70,8 @@ public:
* Create and return an settings object for this paintop when used with the
* specified input device.
*/
virtual KisPaintOpSettingsSP settings(const KoInputDevice& inputDevice, KisImageSP image) = 0;
virtual KisPaintOpSettingsSP settings(KisImageSP image) = 0;
virtual KisPaintOpSettingsSP settings(const KoInputDevice& inputDevice, KisImageWSP image) = 0;
virtual KisPaintOpSettingsSP settings(KisImageWSP image) = 0;
/**
* create a widget that can display paintop settings
......
......@@ -64,7 +64,7 @@ KisPaintOpRegistry* KisPaintOpRegistry::instance()
return KisPaintOpRegistry::m_singleton;
}
KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image) const
KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageWSP image) const
{
if (painter == 0) {
warnKrita << " KisPaintOpRegistry::paintOp painter is null";
......@@ -84,7 +84,7 @@ KisPaintOp * KisPaintOpRegistry::paintOp(const QString & id, const KisPaintOpSet
return 0;
}
KisPaintOp * KisPaintOpRegistry::paintOp(const KisPaintOpPresetSP preset, KisPainter * painter, KisImageSP image) const
KisPaintOp * KisPaintOpRegistry::paintOp(const KisPaintOpPresetSP preset, KisPainter * painter, KisImageWSP image) const
{
Q_ASSERT( preset );
Q_ASSERT( painter );
......@@ -95,7 +95,7 @@ KisPaintOp * KisPaintOpRegistry::paintOp(const KisPaintOpPresetSP preset, KisPai
return paintOp(preset->paintOp().id(), preset->settings(), painter, image);
}
KisPaintOpSettingsSP KisPaintOpRegistry::settings(const KoID& id, const KoInputDevice& inputDevice, KisImageSP image) const
KisPaintOpSettingsSP KisPaintOpRegistry::settings(const KoID& id, const KoInputDevice& inputDevice, KisImageWSP image) const
{
KisPaintOpFactory* f = value(id.id());
Q_ASSERT(f);
......@@ -111,7 +111,7 @@ KisPaintOpSettingsSP KisPaintOpRegistry::settings(const KoID& id, const KoInputD
return 0;
}
KisPaintOpPresetSP KisPaintOpRegistry::defaultPreset(const KoID& id, const KoInputDevice& inputDevice, KisImageSP image) const
KisPaintOpPresetSP KisPaintOpRegistry::defaultPreset(const KoID& id, const KoInputDevice& inputDevice, KisImageWSP image) const
{
KisPaintOpPresetSP preset = new KisPaintOpPreset();
preset->setName(i18n("default"));
......
......@@ -53,7 +53,7 @@ public:
* 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 KisPaintOpPresetSP preset, KisPainter * painter, KisImageSP image) const;
KisPaintOp * paintOp(const KisPaintOpPresetSP preset, KisPainter * painter, KisImageWSP image) const;
/**
* Create and return an (abstracted) configuration widget
......@@ -61,12 +61,12 @@ public:
* with the specified parent as widget parent. Returns 0 if there
* are no settings available for the given device.
*/
KisPaintOpSettingsSP settings(const KoID& id, const KoInputDevice& inputDevice, KisImageSP image = 0) const;
KisPaintOpSettingsSP settings(const KoID& id, const KoInputDevice& inputDevice, KisImageWSP image = 0) const;
/**
* @return a default preset for the given paintop.
*/
KisPaintOpPresetSP defaultPreset(const KoID& id, const KoInputDevice& inputDevice, KisImageSP image = 0) const;
KisPaintOpPresetSP defaultPreset(const KoID& id, const KoInputDevice& inputDevice, KisImageWSP image = 0) const;
// Whether we should show this paintop in the toolchest
bool userVisible(const KoID & id, const KoColorSpace* cs) const;
......@@ -90,7 +90,7 @@ private:
/**
* Return a newly created paintop. You are responsible for deleting
*/
KisPaintOp * paintOp(const QString& id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageSP image = 0) const;
KisPaintOp * paintOp(const QString& id, const KisPaintOpSettingsSP settings, KisPainter * painter, KisImageWSP image = 0) const;
private:
......
......@@ -108,7 +108,7 @@ QImage KisPaintOpSettings::sampleStroke(const QSize& size )
return layer->paintDevice()->convertToQImage(0);
}
QRectF KisPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageSP image, OutlineMode _mode) const
QRectF KisPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const
{
Q_UNUSED(pos);
Q_UNUSED(image);
......@@ -116,7 +116,7 @@ QRectF KisPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageSP image
return QRectF();
}
void KisPaintOpSettings::paintOutline(const QPointF& pos, KisImageSP image, QPainter &painter, const KoViewConverter &converter, OutlineMode _mode) const
void KisPaintOpSettings::paintOutline(const QPointF& pos, KisImageWSP image, QPainter &painter, const KoViewConverter &converter, OutlineMode _mode) const
{
Q_UNUSED(pos);
Q_UNUSED(painter);
......
......@@ -125,7 +125,7 @@ public:
* to brushOutlineRect, and perhaps just return the brushSize and let the caller handle the x,y
* location. If one wants to use QImage, then one use something else
*/
virtual QRectF paintOutlineRect(const QPointF& pos, KisImageSP image, OutlineMode _mode) const;
virtual QRectF paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const;
/**
* This function allow the paintop to draw an outline at a given position.
......@@ -135,7 +135,7 @@ public:
* And we need a lot of caching here, since no matter what we do, it is utterly slow, especially
* when using a tablet. How does XXX works with the duplicate op ? List of images ? With a center ?
*/
virtual void paintOutline(const QPointF& pos, KisImageSP image, QPainter &painter, const KoViewConverter &converter, OutlineMode _mode) const;
virtual void paintOutline(const QPointF& pos, KisImageWSP image, QPainter &painter, const KoViewConverter &converter, OutlineMode _mode) const;
#if defined(HAVE_OPENGL)
virtual QString modelName() const;
......
......@@ -48,7 +48,7 @@ public:
*/
virtual void writeConfiguration( KisPropertiesConfiguration *config ) const = 0;
virtual void setImage( KisImageSP image )
virtual void setImage( KisImageWSP image )
{
m_image = image;
}
......@@ -56,7 +56,7 @@ public:
protected:
KisImageSP m_image;
KisImageWSP m_image;
};
......
......@@ -26,7 +26,7 @@
#include "kis_selection_mask.h"
#include "kis_pixel_selection.h"
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand(KisImageSP image, QUndoCommand * parent) :
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent) :
QUndoCommand(i18n("Deselect"), parent)
, m_image(image)
{
......
......@@ -33,14 +33,14 @@ public:
* @param image the image
* @param parent the parent command
*/
KisDeselectGlobalSelectionCommand(KisImageSP image, QUndoCommand * parent = 0);
KisDeselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent = 0);
virtual ~KisDeselectGlobalSelectionCommand();
virtual void redo();
virtual void undo();
private:
KisImageSP m_image;
KisImageWSP m_image;
KisSelectionSP m_newSelection;
KisSelectionSP m_oldDeselectedSelection;
};
......
......@@ -25,7 +25,7 @@
#include "kis_selection_mask.h"
#include "kis_pixel_selection.h"
KisDeselectLocalSelectionCommand::KisDeselectLocalSelectionCommand(KisImageSP image, KisSelectionMaskSP selectionMask, QUndoCommand * parent) :
KisDeselectLocalSelectionCommand::KisDeselectLocalSelectionCommand(KisImageWSP image, KisSelectionMaskSP selectionMask, QUndoCommand * parent) :
QUndoCommand(i18n("Deselect"), parent)
, m_image(image)
, m_selectionMask(selectionMask)
......
......@@ -33,14 +33,14 @@ public:
* @param selectionMask the the selection mask which will get deselected
* @param parent the parent command
*/
KisDeselectLocalSelectionCommand(KisImageSP image, KisSelectionMaskSP selectionMask, QUndoCommand * parent = 0);
KisDeselectLocalSelectionCommand(KisImageWSP image, KisSelectionMaskSP selectionMask, QUndoCommand * parent = 0);
virtual ~KisDeselectLocalSelectionCommand();
virtual void redo();
virtual void undo();
private:
KisImageSP m_image;
KisImageWSP m_image;
KisSelectionMaskSP m_selectionMask;
KisSelectionSP m_newSelection;
KisSelectionSP m_oldDeselectedSelection;
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageChangeLayersCommand::KisImageChangeLayersCommand(KisImageSP image, KisNodeSP oldRootLayer, KisNodeSP newRootLayer, const QString& name)
KisImageChangeLayersCommand::KisImageChangeLayersCommand(KisImageWSP image, KisNodeSP oldRootLayer, KisNodeSP newRootLayer, const QString& name)
: KisImageCommand(name, image)
{
m_oldRootLayer = oldRootLayer;
......
......@@ -36,7 +36,7 @@ class KisImageChangeLayersCommand : public KisImageCommand
{
public:
KisImageChangeLayersCommand(KisImageSP image, KisNodeSP oldRootLayer, KisNodeSP newRootLayer, const QString& name);
KisImageChangeLayersCommand(KisImageWSP image, KisNodeSP oldRootLayer, KisNodeSP newRootLayer, const QString& name);
virtual void redo();
virtual void undo();
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageCommand::KisImageCommand(const QString& name, KisImageSP image)
KisImageCommand::KisImageCommand(const QString& name, KisImageWSP image)
: QUndoCommand(name)
, m_image(image)
{
......
......@@ -41,7 +41,7 @@ public:
* @param name The name that will be shown in the ui
* @param image The image the command will be working on.
*/
KisImageCommand(const QString& name, KisImageSP image);
KisImageCommand(const QString& name, KisImageWSP image);
virtual ~KisImageCommand();
protected:
......@@ -52,7 +52,7 @@ protected:
*/
void setUndo(bool undo);
KisImageSP m_image;
KisImageWSP m_image;
};
#endif // KIS_IMAGE_COMMAND_H_
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageConvertTypeCommand::KisImageConvertTypeCommand(KisImageSP image, const KoColorSpace * beforeColorSpace, const KoColorSpace * afterColorSpace)
KisImageConvertTypeCommand::KisImageConvertTypeCommand(KisImageWSP image, const KoColorSpace * beforeColorSpace, const KoColorSpace * afterColorSpace)
: KisImageCommand(i18n("Convert Image Type"), image)
{
m_beforeColorSpace = beforeColorSpace;
......
......@@ -35,7 +35,7 @@ class KisImageConvertTypeCommand : public KisImageCommand
{
public:
KisImageConvertTypeCommand(KisImageSP image, const KoColorSpace * beforeColorSpace, const KoColorSpace * afterColorSpace);
KisImageConvertTypeCommand(KisImageWSP image, const KoColorSpace * beforeColorSpace, const KoColorSpace * afterColorSpace);
virtual void redo();
virtual void undo();
......
......@@ -33,7 +33,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageLayerAddCommand::KisImageLayerAddCommand(KisImageSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis)
KisImageLayerAddCommand::KisImageLayerAddCommand(KisImageWSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis)
: KisImageCommand(i18n("Add Layer"), image), m_index( -1 )
{
m_layer = layer;
......@@ -41,7 +41,7 @@ KisImageLayerAddCommand::KisImageLayerAddCommand(KisImageSP image, KisNodeSP lay
m_aboveThis = aboveThis;
}
KisImageLayerAddCommand::KisImageLayerAddCommand(KisImageSP image, KisNodeSP layer, KisNodeSP parent, quint32 index )
KisImageLayerAddCommand::KisImageLayerAddCommand(KisImageWSP image, KisNodeSP layer, KisNodeSP parent, quint32 index )
: KisImageCommand(i18n("Add Layer"), image), m_index( index )
{
m_layer = layer;
......
......@@ -43,8 +43,8 @@ public:
* @param image The image the command will be working on.
* @param layer the layer to add
*/
KisImageLayerAddCommand(KisImageSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis);
KisImageLayerAddCommand(KisImageSP image, KisNodeSP layer, KisNodeSP parent, quint32 index );
KisImageLayerAddCommand(KisImageWSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis);
KisImageLayerAddCommand(KisImageWSP image, KisNodeSP layer, KisNodeSP parent, quint32 index );
virtual void redo();
virtual void undo();
......
......@@ -35,7 +35,7 @@
#include "kis_undo_adapter.h"
KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisImageSP image, KisNodeSP layer, KisNodeSP newParent, KisNodeSP newAbove)
KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisImageWSP image, KisNodeSP layer, KisNodeSP newParent, KisNodeSP newAbove)
: KisImageCommand(i18n("Move Layer"), image)
{
m_layer = layer;
......@@ -46,7 +46,7 @@ KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisImageSP image, KisNodeSP l
m_index = -1;
}
KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisImageSP image, KisNodeSP node, KisNodeSP newParent, quint32 index)
KisImageLayerMoveCommand::KisImageLayerMoveCommand(KisImageWSP image, KisNodeSP node, KisNodeSP newParent, quint32 index)
: KisImageCommand(i18n("Move Layer"), image)
{
m_layer = node;
......
......@@ -46,8 +46,8 @@ public:
* @param newParent the next parent of the layer
* @param newAbove the layer that will be below the layer after the move
*/
KisImageLayerMoveCommand(KisImageSP image, KisNodeSP node, KisNodeSP newParent, KisNodeSP newAbove);
KisImageLayerMoveCommand(KisImageSP image, KisNodeSP node, KisNodeSP newParent, quint32 index);
KisImageLayerMoveCommand(KisImageWSP image, KisNodeSP node, KisNodeSP newParent, KisNodeSP newAbove);
KisImageLayerMoveCommand(KisImageWSP image, KisNodeSP node, KisNodeSP newParent, quint32 index);
virtual void redo();
virtual void undo();
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageLayerRemoveCommand::KisImageLayerRemoveCommand(KisImageSP image, KisNodeSP layer)
KisImageLayerRemoveCommand::KisImageLayerRemoveCommand(KisImageWSP image, KisNodeSP layer)
: KisImageCommand(i18n("Remove Layer"), image)
{
m_layer = layer;
......
......@@ -46,7 +46,7 @@ public:
* @param wasParent the parent of the layer
* @param wasAbove the layer above the layer
*/
KisImageLayerRemoveCommand(KisImageSP image, KisNodeSP layer);
KisImageLayerRemoveCommand(KisImageWSP image, KisNodeSP layer);
virtual void redo();
virtual void undo();
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImageLockCommand::KisImageLockCommand(KisImageSP image, bool lockImage)
KisImageLockCommand::KisImageLockCommand(KisImageWSP image, bool lockImage)
: KisImageCommand("lock image", image) // Not for translation, this is only ever used inside a macro command.
{
m_lockImage = lockImage;
......
......@@ -46,7 +46,7 @@ public:
* @param image The image the command will be working on.
* @param lockImage Locking state of the image, while redo.
*/
KisImageLockCommand(KisImageSP image, bool lockImage);
KisImageLockCommand(KisImageWSP image, bool lockImage);
virtual void redo();
virtual void undo();
......
......@@ -24,7 +24,7 @@
#include "kis_image.h"
#include "kis_undo_adapter.h"
KisImageNodeLowerCommand::KisImageNodeLowerCommand(KisImageSP image, KisNodeSP node )
KisImageNodeLowerCommand::KisImageNodeLowerCommand(KisImageWSP image, KisNodeSP node )
: KisImageCommand(i18n("Lower"), image), m_node(node)
{
}
......
......@@ -35,7 +35,7 @@ public:
* @param image The image the command will be working on.
* @param layer the layer to add
*/
KisImageNodeLowerCommand(KisImageSP image, KisNodeSP node );
KisImageNodeLowerCommand(KisImageWSP image, KisNodeSP node );
virtual void redo();
virtual void undo();
......
......@@ -24,7 +24,7 @@
#include "kis_image.h"
#include "kis_undo_adapter.h"
KisImageNodeRaiseCommand::KisImageNodeRaiseCommand(KisImageSP image, KisNodeSP node )
KisImageNodeRaiseCommand::KisImageNodeRaiseCommand(KisImageWSP image, KisNodeSP node )
: KisImageCommand(i18n("Raise"), image), m_node(node)
{
}
......
......@@ -35,7 +35,7 @@ public:
* @param image The image the command will be working on.
* @param layer the layer to add
*/
KisImageNodeRaiseCommand(KisImageSP image, KisNodeSP node );
KisImageNodeRaiseCommand(KisImageWSP image, KisNodeSP node );
virtual void redo();
virtual void undo();
......
......@@ -25,7 +25,7 @@
#include "kis_undo_adapter.h"
#include "../kis_image.h"
KisImageNodeToBottomCommand::KisImageNodeToBottomCommand(KisImageSP image, KisNodeSP node )
KisImageNodeToBottomCommand::KisImageNodeToBottomCommand(KisImageWSP image, KisNodeSP node )
: KisImageCommand(i18n("Lower"), image), m_node(node)
{
m_prevParent = m_node->parent();
......
......@@ -35,7 +35,7 @@ public:
* @param image The image the command will be working on.
* @param layer the layer to add
*/
KisImageNodeToBottomCommand(KisImageSP image, KisNodeSP node );
KisImageNodeToBottomCommand(KisImageWSP image, KisNodeSP node );
virtual void redo();
virtual void undo();
......
......@@ -24,7 +24,7 @@
#include "kis_image.h"
#include "kis_undo_adapter.h"
KisImageNodeToTopCommand::KisImageNodeToTopCommand(KisImageSP image, KisNodeSP node )
KisImageNodeToTopCommand::KisImageNodeToTopCommand(KisImageWSP image, KisNodeSP node )
: KisImageCommand(i18n("Lower"), image), m_node(node)
{
m_prevParent = m_node->parent();
......
......@@ -34,7 +34,7 @@ public:
* @param image The image the command will be working on.
* @param layer the layer to add
*/
KisImageNodeToTopCommand(KisImageSP image, KisNodeSP node );
KisImageNodeToTopCommand(KisImageWSP image, KisNodeSP node );
virtual void redo();
virtual void undo();
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"
#include "kis_undo_adapter.h"
KisImagePropsCommand::KisImagePropsCommand(KisImageSP image, const KoColorSpace* newColorSpace)
KisImagePropsCommand::KisImagePropsCommand(KisImageWSP image, const KoColorSpace* newColorSpace)
: KisImageCommand(i18n("Property Changes"), image)
, m_newColorSpace(newColorSpace)
{
......
......@@ -45,7 +45,7 @@ public:
* @param newColorSpace the new image color space
* @param newResolution the new image resolution which will be used for xRes and yRes
*/
KisImagePropsCommand(KisImageSP image, const KoColorSpace* newColorSpace);
KisImagePropsCommand(KisImageWSP image, const KoColorSpace* newColorSpace);
virtual void redo();
virtual void undo();
......
......@@ -34,7 +34,7 @@
#include "kis_group_layer.h"