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::buttonPress(KisButtonPressEvent *) 00056 { 00057 } 00058 00059 void KisToolNonPaint::move(KisMoveEvent *) 00060 { 00061 } 00062 00063 void KisToolNonPaint::buttonRelease(KisButtonReleaseEvent *) 00064 { 00065 } 00066 00067 void KisToolNonPaint::doubleClick(KisDoubleClickEvent *) 00068 { 00069 } 00070 00071 void KisToolNonPaint::keyPress(QKeyEvent *) 00072 { 00073 } 00074 00075 void KisToolNonPaint::keyRelease(QKeyEvent *) 00076 { 00077 } 00078 00079 QCursor KisToolNonPaint::cursor() 00080 { 00081 return m_cursor; 00082 } 00083 00084 void KisToolNonPaint::setCursor(const QCursor& cursor) 00085 { 00086 m_cursor = cursor; 00087 00088 if (m_subject) { 00089 KisToolControllerInterface *controller = m_subject->toolController(); 00090 00091 if (controller && controller->currentTool() == this) { 00092 m_subject->canvasController()->setCanvasCursor(m_cursor); 00093 } 00094 } 00095 } 00096 00097 void KisToolNonPaint::activate() 00098 { 00099 if (m_subject) { 00100 KisToolControllerInterface *controller = m_subject->toolController(); 00101 00102 if (controller) 00103 controller->setCurrentTool(this); 00104 } 00105 } 00106 00107 void KisToolNonPaint::notifyModified() const 00108 { 00109 if (m_subject && m_subject->currentImg()) { 00110 00111 m_subject->currentImg()->setModified(); 00112 } 00113 } 00114 00115 #include "kis_tool_non_paint.moc"