SVN commit 853994 by cgilles:
digiKam from KDE3 : Inpainting image plugin is now ported to Editor Tool API CCMAIL: [hidden email] M +2 -3 Makefile.am D imageeffect_inpainting.cpp D imageeffect_inpainting.h M +38 -13 imageplugin_inpainting.cpp M +8 -8 imageplugin_inpainting.h A inpaintingtool.cpp imageeffect_inpainting.cpp#853945 [License: GPL (v2+)] A inpaintingtool.h imageeffect_inpainting.h#853945 [License: GPL (v2+)] --- branches/extragear/kde3/graphics/digikam/imageplugins/inpainting/Makefile.am #853993:853994 @@ -19,7 +19,7 @@ $(all_includes) digikamimageplugin_inpainting_la_SOURCES = imageplugin_inpainting.cpp \ - imageeffect_inpainting.cpp + inpaintingtool.cpp digikamimageplugin_inpainting_la_LIBADD = $(LIB_KPARTS) \ $(top_builddir)/digikam/digikam/libdigikam.la @@ -31,5 +31,4 @@ kde_module_LTLIBRARIES = digikamimageplugin_inpainting.la rcdir = $(kde_datadir)/digikam -rc_DATA = digikamimageplugin_inpainting_ui.rc - +rc_DATA = digikamimageplugin_inpainting_ui.rc --- branches/extragear/kde3/graphics/digikam/imageplugins/inpainting/imageplugin_inpainting.cpp #853993:853994 @@ -6,20 +6,20 @@ * Date : 2005-03-30 * Description : a digiKam image editor plugin to inpaint * a photograph - * - * Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> - * + * + * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com> + * * 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, 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. - * + * * ============================================================ */ // KDE includes. @@ -29,14 +29,19 @@ #include <klibloader.h> #include <kaction.h> #include <kcursor.h> +#include <kapplication.h> // Local includes. #include "ddebug.h" -#include "imageeffect_inpainting.h" +#include "imageiface.h" +#include "inpaintingtool.h" #include "imageplugin_inpainting.h" #include "imageplugin_inpainting.moc" +using namespace DigikamInPaintingImagesPlugin; +using namespace Digikam; + K_EXPORT_COMPONENT_FACTORY(digikamimageplugin_inpainting, KGenericFactory<ImagePlugin_InPainting>("digikamimageplugin_inpainting")); @@ -47,12 +52,12 @@ CTRL+Key_E, this, SLOT(slotInPainting()), actionCollection(), "imageplugin_inpainting"); - + m_inPaintingAction->setWhatsThis( i18n( "This filter can be used to inpaint a part in a photo. " - "Select a region to inpaint to use this option.") ); - - setXMLFile( "digikamimageplugin_inpainting_ui.rc" ); - + "Select a region to inpaint to use this option.") ); + + setXMLFile( "digikamimageplugin_inpainting_ui.rc" ); + DDebug() << "ImagePlugin_InPainting plugin loaded" << endl; } @@ -67,6 +72,26 @@ void ImagePlugin_InPainting::slotInPainting() { - DigikamInPaintingImagesPlugin::ImageEffect_InPainting::inPainting(parentWidget()); + + ImageIface iface(0, 0); + + int w = iface.selectedWidth(); + int h = iface.selectedHeight(); + + if (!w || !h) + { + InPaintingPassivePopup* popup = new InPaintingPassivePopup(kapp->activeWindow()); + popup->setView(i18n("Inpainting Photograph Tool"), + i18n("You need to select a region to inpaint to use " + "this tool")); + popup->setAutoDelete(true); + popup->setTimeout(2500); + popup->show(); + return; + } + + // -- run the dlg ---------------------------------------------- + + InPaintingTool *tool = new InPaintingTool(this); + loadTool(tool); } - --- branches/extragear/kde3/graphics/digikam/imageplugins/inpainting/imageplugin_inpainting.h #853993:853994 @@ -6,20 +6,20 @@ * Date : 2005-03-30 * Description : a digiKam image editor plugin to inpaint * a photograph - * - * Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> - * + * + * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com> + * * 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, 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. - * + * * ============================================================ */ #ifndef IMAGEPLUGIN_INPAINTING_H @@ -35,7 +35,7 @@ class DIGIKAMIMAGEPLUGINS_EXPORT ImagePlugin_InPainting : public Digikam::ImagePlugin { Q_OBJECT - + public: ImagePlugin_InPainting(QObject *parent, const char* name, @@ -47,10 +47,10 @@ private slots: void slotInPainting(); - + private: KAction *m_inPaintingAction; }; - + #endif /* IMAGEPLUGIN_INPAINTING_H */ _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |