Commit ee8d177e authored by Patrick Julien's avatar Patrick Julien

warning fixes

svn path=/trunk/koffice/; revision=182295
parent 808fe99e
......@@ -4,9 +4,9 @@ INCLUDES = -I$(srcdir)/helper/ -I$(srcdir)/tiles/ -I$(srcdir)/../ui -I$(srcdir)
noinst_LTLIBRARIES = libkiscore.la
libkiscore_la_SOURCES = kis_paint_device.cc kis_layer.cc kis_channel.cc kis_mask.cc kis_image.cc kis_doc.cc\
kis_view.cc kis_tool.cc kis_factory.cc kis_pluginserver.cc kis_resourceserver.cc kis_timer.cc \
kis_view.cc kis_tool.cc kis_factory.cc kis_pluginserver.cc kis_resourceserver.cc \
kis_brush.cc kis_krayon.cc kis_pattern.cc kis_image_builder.cc kis_util.cc kis_nameserver.cc \
kis_painter.cc
kis_painter.cc kis_tool_memento.cc
libkiscore_la_METASOURCES = AUTO
libkiscore_la_LDFLAGS = $(KDE_RPATH) $(LIBMAGICK_RPATH)
......
......@@ -305,7 +305,7 @@ QDomElement KisDoc::saveImages(QDomDocument& doc)
}
// save layers
QDomElement KisDoc::saveLayers(QDomDocument& doc, KisImageSP img)
QDomElement KisDoc::saveLayers(QDomDocument& doc, KisImageSP)
{
// layers element - variable
QDomElement layersElement = doc.createElement("layers");
......@@ -506,6 +506,7 @@ bool KisDoc::loadImages(QDomElement& element)
// load layers
bool KisDoc::loadLayers(QDomElement& /*element*/, KisImageSP /*img*/)
{
return false;
#if 0
QDomElement layers = element.namedItem("layers").toElement();
......@@ -1207,23 +1208,23 @@ bool KisDoc::loadNativeFormat(const QString& file)
return false;
}
void KisDoc::slotActiveLayerChanged(KisImageSP img)
void KisDoc::slotActiveLayerChanged(KisImageSP)
{
}
void KisDoc::slotAlphaChanged(KisImageSP img)
void KisDoc::slotAlphaChanged(KisImageSP)
{
}
void KisDoc::slotSelectionChanged(KisImageSP img)
void KisDoc::slotSelectionChanged(KisImageSP)
{
}
void KisDoc::slotVisibilityChanged(KisImageSP img, CHANNELTYPE ctype)
void KisDoc::slotVisibilityChanged(KisImageSP, CHANNELTYPE)
{
}
void KisDoc::slotUpdate(KisImageSP img, Q_UINT32 x, Q_UINT32 y, Q_UINT32 w, Q_UINT32 h)
void KisDoc::slotUpdate(KisImageSP, Q_UINT32 x, Q_UINT32 y, Q_UINT32 w, Q_UINT32 h)
{
QRect rc(x, y, w, h);
......
......@@ -19,6 +19,7 @@
#include <qpainter.h>
#include <qpixmap.h>
#include <qtl.h>
#include <kdebug.h>
#include "kis_image.h"
#include "kis_paint_device.h"
#include "kis_painter.h"
......@@ -140,6 +141,9 @@ void KisImage::init(KisDoc *doc, Q_INT32 width, Q_INT32 height, Q_UINT32 depth,
case IMAGE_TYPE_CMYKA:
n = 4;
break;
default:
kdDebug() << "KisImage::init Unknow image type.\n";
break;
}
m_active.resize(n);
......
......@@ -31,7 +31,7 @@ KisLayer::KisLayer(KisImageSP img, Q_INT32 width, Q_INT32 height, const QString&
m_opacity = opacity;
}
KisLayer::KisLayer(KisTileMgr tiles, KisImageSP img, const QString& name, QUANTUM opacity)
KisLayer::KisLayer(KisTileMgr, KisImageSP img, const QString& name, QUANTUM opacity)
: super(img, img -> width(), img -> height(), img -> imgType(), name)
{
m_linked = false;
......@@ -42,30 +42,30 @@ KisLayer::~KisLayer()
{
}
void KisLayer::copy(const KisPaintDevice& rhs, bool addAlpha)
void KisLayer::copy(const KisPaintDevice& , bool )
{
}
bool KisLayer::checkScaling(Q_INT32 width, Q_INT32 height)
bool KisLayer::checkScaling(Q_INT32 , Q_INT32 )
{
return false;
}
KisMaskSP KisLayer::createMask(Q_INT32 maskType)
KisMaskSP KisLayer::createMask(Q_INT32 )
{
return 0;
}
KisMaskSP KisLayer::addMask(KisMaskSP mask)
KisMaskSP KisLayer::addMask(KisMaskSP )
{
return 0;
}
void KisLayer::applyMask(Q_INT32 mode)
void KisLayer::applyMask(Q_INT32 )
{
}
void KisLayer::translate(Q_INT32 x, Q_INT32 y)
void KisLayer::translate(Q_INT32 , Q_INT32 )
{
}
......@@ -73,23 +73,23 @@ void KisLayer::addAlpha()
{
}
void KisLayer::scaleFactor(double wfactor, double hfactor)
void KisLayer::scaleFactor(double , double )
{
}
void KisLayer::scale(Q_INT32 width, Q_INT32 height, Q_INT32 interpolation, bool localOrigin)
void KisLayer::scale(Q_INT32 , Q_INT32 , Q_INT32 , bool )
{
}
void KisLayer::scale(const QSize& size, Q_INT32 interpolation, bool localOrigin)
void KisLayer::scale(const QSize& , Q_INT32 , bool )
{
}
void KisLayer::resize(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h)
void KisLayer::resize(Q_INT32 , Q_INT32 , Q_INT32 , Q_INT32 )
{
}
void KisLayer::resize(const QRect& rc)
void KisLayer::resize(const QRect& )
{
}
......@@ -97,7 +97,7 @@ void KisLayer::resize()
{
}
void KisLayer::boundary(const vKisSegments& segments)
void KisLayer::boundary(const vKisSegments& )
{
}
......
......@@ -17,6 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string.h>
#include <kdebug.h>
#include <koColor.h>
#include "kis_types.h"
#include "kis_global.h"
......@@ -254,6 +255,9 @@ void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, CompositeOp op, KisPixelDataSP s
}
}
break;
default:
kdDebug() << "Not Implemented.\n";
break;
}
}
......
......@@ -52,6 +52,7 @@ inline
KisRenderInterface& KisRenderInterface::operator=(const KisRenderInterface& rhs)
{
KShared::operator=(rhs);
return *this;
}
inline
......
......@@ -29,13 +29,10 @@
#include "kis_factory.h"
#include "kis_resourceserver.h"
#include "kis_timer.h"
KisResourceServer::KisResourceServer()
{
KisTimer::start();
m_brushes.setAutoDelete(true);
m_patterns.setAutoDelete(true);
......@@ -80,8 +77,6 @@ KisTimer::start();
(void) loadPattern( file );
}
KisTimer::stop("KisResourceServer()");
}
KisResourceServer::~KisResourceServer()
......
/*
* kis_tool.cc - part of KImageShop
*
* Copyright (c) 1999 Matthias Elter <me@kde.org>
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
*
......@@ -19,6 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if 0
#include <qevent.h>
#include <qpainter.h>
#include <qpointarray.h>
......@@ -524,3 +523,4 @@ const KisView* KisTool::getCurrentView() const
}
#include "kis_tool.moc"
#endif
/*
* kis_tool.h - part of KImageShop
*
* Copyright (c) 1999 Matthias Elter <me@kde.org>
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
*
......@@ -18,116 +16,59 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined KIS_TOOL_H_
#define KIS_TOOL_H_
#ifndef __kis_tool_h__
#define __kis_tool_h__
#include <qcursor.h>
#include <qdom.h>
#include <qimage.h>
#include <qobject.h>
#include <qpixmap.h>
#include <qpoint.h>
#include <qpointarray.h>
#include <qrect.h>
#include <qevent.h>
#include <qstring.h>
#include <ksharedptr.h>
#include "kis_brush.h"
#include "kis_types.h"
#include "kis_cursor.h"
#include "kis_pattern.h"
class QEvent;
class QPaintEvent;
class QPainter;
class QMouseEvent;
class KisCanvas;
class KisDoc;
class KisView;
class KisTool : public QObject, public KShared {
Q_OBJECT
class QRect;
class KisToolInterface : public KShared {
public:
KisTool(KisDoc *doc, const char *name = 0);
virtual ~KisTool();
virtual void setupAction(QObject *collection) = 0;
KisToolInterface();
virtual ~KisToolInterface();
virtual QString settingsName() const;
virtual QDomElement saveSettings(QDomDocument& doc) const;
virtual bool loadSettings(QDomElement& elem);
virtual void optionsDialog();
virtual void clearOld();
virtual bool shouldRepaint() const;
virtual bool willModify() const;
virtual QCursor cursor() const;
virtual void setCursor(const QCursor& cursor);
virtual void setCursor();
virtual void setPattern(KisPattern *pattern);
virtual void setBrush(KisBrush *b);
virtual void setChecked(bool check);
virtual bool setClip();
public:
virtual QString name() const = 0;
virtual QString description() const = 0;
virtual QString groupName() const = 0;
virtual void paint(QPaintEvent *e) = 0;
virtual void clear() = 0;
virtual void clear(const QRect& rc) = 0;
virtual void enter(QEvent *e) = 0;
virtual void leave(QEvent *e) = 0;
virtual void mousePress(QMouseEvent *e) = 0;
virtual void mouseMove(QMouseEvent *e) = 0;
virtual void mouseRelease(QMouseEvent *e) = 0;
virtual void keyPress(QKeyEvent *e) = 0;
virtual void setCursor(const QCursor& cursor) = 0;
virtual void cursor(QWidget *w) const = 0;
virtual KDialog *options() = 0;
void setSelectCursor();
void setMoveCursor();
KisView* getCurrentView();
const KisView* getCurrentView() const;
public slots:
virtual void toolSelect();
virtual void paintEvent(QPaintEvent *e);
virtual void enterEvent(QEvent *e);
virtual void leaveEvent(QEvent *e);
virtual void mousePress(QMouseEvent *e);
virtual void mouseMove(QMouseEvent *e);
virtual void mouseRelease(QMouseEvent *e);
protected:
int zoomed(int n) const;
QPoint zoomed(const QPoint& point) const;
int zoomedX(int n) const;
int zoomedY(int n) const;
QRect getDrawRect(const QPointArray& points) const;
QPointArray zoomPointArray(const QPointArray& points) const;
void setClipImage();
void dragSelectImage(const QPoint& dragPoint, const QPoint& hotSpot);
bool pasteClipImage(const QPoint& pos);
protected:
#if 0
KisDoc *m_doc;
KisPattern *m_pattern;
KisBrush *m_brush;
KisCanvas *m_canvas;
QCursor m_cursor;
QPixmap m_clipPixmap;
QImage m_clipImage;
unsigned int m_opacity;
bool m_usePattern;
bool m_useGradient;
bool m_useRegions;
bool m_fillSolid;
#endif
private:
KisTool(const KisTool&);
KisTool& operator=(const KisTool&);
virtual void save(KisToolMementoSP memento) = 0;
virtual void restore(KisToolMementoSP memento) = 0;
private:
#if 0
unsigned int m_paintThreshold;
bool m_paintWithPattern;
bool m_paintWithGradient;
#endif
KisToolInterface(const KisToolInterface&);
KisToolInterface& operator=(const KisToolInterface&);
};
#endif
inline
KisToolInterface::KisToolInterface() : KShared()
{
}
inline
KisToolInterface::~KisToolInterface()
{
}
#endif // KIS_TOOL_H_
/*
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined KIS_TOOL_MEMENTO_H_
#define KIS_TOOL_MEMENTO_H_
#include <ksharedptr.h>
#include "kis_types.h"
class KisToolMemento : public KShared {
};
#endif // KIS_TOOL_MEMENTO_H_
......@@ -22,12 +22,6 @@
#include <ksharedptr.h>
#include <koColor.h>
class KisPaintDeviceObserverInterface;
typedef KSharedPtr<KisPaintDeviceObserverInterface> KisPaintDeviceObserverSP;
class KisPaintDeviceSubjectInterface;
typedef KSharedPtr<KisPaintDeviceSubjectInterface> KisPaintDeviceSubjectSP;
class KisImage;
typedef KSharedPtr<KisImage> KisImageSP;
typedef QValueVector<KisImageSP> vKisImageSP;
......@@ -62,7 +56,7 @@ class KisTile;
typedef KSharedPtr<KisTile> KisTileSP;
typedef QValueVector<KisTileSP> vKisTileSP;
typedef vKisTileSP::iterator vKisTileSP_it;
typedef vKisTileSP::const_iterator vKisTileSPLst_cit;
typedef vKisTileSP::const_iterator vKisTileSP_cit;
class KisTileMgr;
typedef KSharedPtr<KisTileMgr> KisTileMgrSP;
......@@ -75,5 +69,14 @@ typedef QValueVector<QPoint> vKisSegments;
class KoColor;
typedef QValueVector<KoColor> KoColorMap;
class KisToolInterface;
typedef KSharedPtr<KisToolInterface> KisToolSP;
typedef QValueVector<KisToolSP> vKisToolSP;
typedef vKisToolSP::iterator vKisToolSP_it;
typedef vKisToolSP::const_iterator vKisToolSP_cit;
class KisToolMemento;
typedef KSharedPtr<KisToolMemento> KisToolMementoSP;
#endif // KISTYPES_H_
......@@ -60,6 +60,7 @@
#include "kis_resourceserver.h"
#include "kis_sidebar.h"
#include "kis_tabbar.h"
#include "kis_tool.h"
#include "kis_view.h"
#include "kis_util.h"
......@@ -119,23 +120,16 @@ KisView::KisView(KisDoc *doc, QWidget *parent, const char *name) : super(doc, pa
m_gradient = 0;
m_layerBox = 0;
setInstance(KisFactory::global());
connect(m_doc, SIGNAL(layersUpdated(KisImageSP)), SLOT(layersUpdated(KisImageSP)));
connect(m_doc, SIGNAL(projectionUpdated(KisImageSP)), SLOT(projectionUpdated(KisImageSP)));
#if 0
m_pTool = 0;
QObject::connect(this, SIGNAL(embeddImage(const QString&)), this, SLOT(slotEmbedImage(const QString&)));
#endif
setupActions();
setupCanvas();
setupRulers();
setupScrollBars();
setupSideBar();
setupTabBar();
connect(m_doc, SIGNAL(imageListUpdated()), SLOT(docImageListUpdate()));
dcopObject();
connect(m_doc, SIGNAL(imageListUpdated()), SLOT(docImageListUpdate()));
connect(m_doc, SIGNAL(layersUpdated(KisImageSP)), SLOT(layersUpdated(KisImageSP)));
connect(m_doc, SIGNAL(projectionUpdated(KisImageSP)), SLOT(projectionUpdated(KisImageSP)));
}
KisView::~KisView()
......@@ -1040,6 +1034,10 @@ Q_INT32 KisView::importImage(bool createLayer, const QString& filename)
KMessageBox::error(this, i18n("Empty file."), i18n("Error Loading File"));
KNotifyClient::event("cannotopenfile");
break;
case KisImageBuilder_RESULT_FAILURE:
KMessageBox::error(this, i18n("Error Loading File."), i18n("Error Loading File"));
KNotifyClient::event("cannotopenfile");
break;
case KisImageBuilder_RESULT_OK:
break;
}
......
......@@ -251,6 +251,7 @@ private:
KisGradient *m_gradient;
KisListBox *m_layerBox;
KisChannelView *m_channelView;
KisToolSP m_tool;
private:
mutable KisImageSP m_current;
......
......@@ -90,7 +90,7 @@ Q_INT32 KisTileMediator::tileNum(KisTileSP tile, KisTileMgrSP mgr)
{
KisScopedLock l(&KisTileMediator::m_mutex);
KisTileMediator::m_instance -> tileNum(tile, mgr);
return KisTileMediator::m_instance -> tileNum(tile, mgr);
}
void KisTileMediator::detachAll(KisTileMgr *mgr)
......
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