krita

kis_tool_non_paint.cc

00001 /*
00002  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
00003  *  Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #include <kdebug.h>
00021 
00022 #include "kis_image.h"
00023 #include "kis_canvas_subject.h"
00024 #include "kis_canvas_controller.h"
00025 #include "kis_tool_controller.h"
00026 #include "kis_tool_non_paint.h"
00027 
00028 KisToolNonPaint::KisToolNonPaint(const QString & UIName)
00029     : super(UIName)
00030 {
00031     m_subject = 0;
00032 }
00033 
00034 KisToolNonPaint::~KisToolNonPaint()
00035 {
00036 }
00037 
00038 void KisToolNonPaint::update(KisCanvasSubject *subject)
00039 {
00040     m_subject = subject;
00041 }
00042 
00043 void KisToolNonPaint::paint(KisCanvasPainter&)
00044 {
00045 }
00046 
00047 void KisToolNonPaint::paint(KisCanvasPainter&, const QRect&)
00048 {
00049 }
00050 
00051 void KisToolNonPaint::deactivate()
00052 {
00053 }
00054 
00055 void KisToolNonPaint::enter(QEvent *)
00056 {
00057 }
00058 
00059 void KisToolNonPaint::leave(QEvent *)
00060 {
00061 }
00062 
00063 void KisToolNonPaint::buttonPress(KisButtonPressEvent *)
00064 {
00065 }
00066 
00067 void KisToolNonPaint::move(KisMoveEvent *)
00068 {
00069 }
00070 
00071 void KisToolNonPaint::buttonRelease(KisButtonReleaseEvent *)
00072 {
00073 }
00074 
00075 void KisToolNonPaint::doubleClick(KisDoubleClickEvent *)
00076 {
00077 }
00078 
00079 void KisToolNonPaint::keyPress(QKeyEvent *)
00080 {
00081 }
00082 
00083 void KisToolNonPaint::keyRelease(QKeyEvent *)
00084 {
00085 }
00086 
00087 QCursor KisToolNonPaint::cursor()
00088 {
00089     return m_cursor;
00090 }
00091 
00092 void KisToolNonPaint::setCursor(const QCursor& cursor)
00093 {
00094     m_cursor = cursor;
00095 
00096     if (m_subject) {
00097         KisToolControllerInterface *controller = m_subject->toolController();
00098 
00099         if (controller && controller->currentTool() == this) {
00100             m_subject->canvasController()->setCanvasCursor(m_cursor);
00101         }
00102     }
00103 }
00104 
00105 void KisToolNonPaint::activate()
00106 {
00107     if (m_subject) {
00108         KisToolControllerInterface *controller = m_subject->toolController();
00109 
00110         if (controller)
00111             controller->setCurrentTool(this);
00112     }
00113 }
00114 
00115 void KisToolNonPaint::notifyModified() const
00116 {
00117     if (m_subject && m_subject->currentImg()) {
00118         
00119         m_subject->currentImg()->setModified();
00120     }
00121 }
00122 
00123 #include "kis_tool_non_paint.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys