SVN commit 683769 by cgilles:
digiKam from trunk: complete KDE4 port of Texture image plugin. CCMAIL: [hidden email] M +11 -17 CMakeLists.txt M +42 -43 imageeffect_texture.cpp M +1 -1 imageeffect_texture.h M +5 -3 imageplugin_texture.cpp M +1 -2 imageplugin_texture.h M +1 -1 texture.h --- trunk/extragear/graphics/digikam/imageplugins/texture/CMakeLists.txt #683768:683769 @@ -1,24 +1,18 @@ -add_subdirectory( patterns ) +ADD_SUBDIRECTORY( patterns ) -include_directories( ${CMAKE_SOURCE_DIR}/digikam/utilities/imageeditor/editor ${CMAKE_SOURCE_DIR}/digikam/utilities/imageeditor/canvas ${CMAKE_SOURCE_DIR}/digikam/libs/histogram ${CMAKE_SOURCE_DIR}/digikam/libs/levels ${CMAKE_SOURCE_DIR}/digikam/libs/curves ${CMAKE_SOURCE_DIR}/digikam/libs/whitebalance ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/common ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/iccprofiles ${CMAKE_SOURCE_DIR}/digikam/libs/widgets/imageplugins ${CMAKE_SOURCE_DIR}/digikam/libs/dialogs ${CMAKE_SOURCE_DIR}/digikam/libs/dimg ${CMAKE_SOURCE_DIR}/digikam/libs/dmetadata ${CMAKE_SOURCE_DIR}/digikam/libs/dimg/filters ${CMAKE_SOURCE_DIR}/digikam/digikam ) +SET(digikamimageplugin_texture_PART_SRCS imageplugin_texture.cpp + imageeffect_texture.cpp + texture.cpp + ) +KDE4_AUTOMOC(${digikamimageplugin_texture_PART_SRCS}) -########### next target ############### +KDE4_ADD_PLUGIN(digikamimageplugin_texture ${digikamimageplugin_texture_PART_SRCS}) -set(digikamimageplugin_texture_PART_SRCS imageplugin_texture.cpp imageeffect_texture.cpp texture.cpp ) +TARGET_LINK_LIBRARIES(digikamimageplugin_texture digikam) +INSTALL(TARGETS digikamimageplugin_texture DESTINATION ${PLUGIN_INSTALL_DIR}) -kde4_automoc(${digikamimageplugin_texture_PART_SRCS}) - -kde4_add_plugin(digikamimageplugin_texture ${digikamimageplugin_texture_PART_SRCS}) - -target_link_libraries(digikamimageplugin_texture digikam ) - -install(TARGETS digikamimageplugin_texture DESTINATION ${PLUGIN_INSTALL_DIR} ) - - -########### install files ############### - -install( FILES digikamimageplugin_texture_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam ) -install( FILES digikamimageplugin_texture.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) +INSTALL(FILES digikamimageplugin_texture_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam) +INSTALL(FILES digikamimageplugin_texture.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- trunk/extragear/graphics/digikam/imageplugins/texture/imageeffect_texture.cpp #683768:683769 @@ -24,14 +24,11 @@ // Qt includes. -#include <qlabel.h> +#include <QLabel> +#include <QComboBox> +#include <QImage> +#include <QGridLayout> -#include <qlayout.h> -#include <qcombobox.h> -#include <qimage.h> -//Added by qt3to4: -#include <Q3GridLayout> - // KDE includes. #include <kconfig.h> @@ -86,40 +83,45 @@ // ------------------------------------------------------------- QWidget *gboxSettings = new QWidget(m_imagePreviewWidget); - Q3GridLayout* gridSettings = new Q3GridLayout( gboxSettings, 2, 1, 0, spacingHint()); + QGridLayout* gridSettings = new QGridLayout(gboxSettings); + QLabel *label1 = new QLabel(i18n("Type:"), gboxSettings); - m_textureType = new QComboBox( false, gboxSettings ); - m_textureType->insertItem( i18n("Paper") ); - m_textureType->insertItem( i18n("Paper 2") ); - m_textureType->insertItem( i18n("Fabric") ); - m_textureType->insertItem( i18n("Burlap") ); - m_textureType->insertItem( i18n("Bricks") ); - m_textureType->insertItem( i18n("Bricks 2") ); - m_textureType->insertItem( i18n("Canvas") ); - m_textureType->insertItem( i18n("Marble") ); - m_textureType->insertItem( i18n("Marble 2") ); - m_textureType->insertItem( i18n("Blue Jean") ); - m_textureType->insertItem( i18n("Cell Wood") ); - m_textureType->insertItem( i18n("Metal Wire") ); - m_textureType->insertItem( i18n("Modern") ); - m_textureType->insertItem( i18n("Wall") ); - m_textureType->insertItem( i18n("Moss") ); - m_textureType->insertItem( i18n("Stone") ); + m_textureType = new QComboBox( gboxSettings ); + m_textureType->addItem( i18n("Paper") ); + m_textureType->addItem( i18n("Paper 2") ); + m_textureType->addItem( i18n("Fabric") ); + m_textureType->addItem( i18n("Burlap") ); + m_textureType->addItem( i18n("Bricks") ); + m_textureType->addItem( i18n("Bricks 2") ); + m_textureType->addItem( i18n("Canvas") ); + m_textureType->addItem( i18n("Marble") ); + m_textureType->addItem( i18n("Marble 2") ); + m_textureType->addItem( i18n("Blue Jean") ); + m_textureType->addItem( i18n("Cell Wood") ); + m_textureType->addItem( i18n("Metal Wire") ); + m_textureType->addItem( i18n("Modern") ); + m_textureType->addItem( i18n("Wall") ); + m_textureType->addItem( i18n("Moss") ); + m_textureType->addItem( i18n("Stone") ); m_textureType->setWhatsThis( i18n("<p>Set here the texture type to apply on image.")); - gridSettings->addMultiCellWidget(label1, 0, 0, 0, 0); - gridSettings->addMultiCellWidget(m_textureType, 0, 0, 1, 1); - // ------------------------------------------------------------- QLabel *label2 = new QLabel(i18n("Relief:"), gboxSettings); - m_blendGain = new KIntNumInput(gboxSettings); + m_blendGain = new KIntNumInput(gboxSettings); m_blendGain->setRange(1, 255, 1, true); m_blendGain->setValue(200); - m_blendGain->setWhatsThis( i18n("<p>Set here the relief gain used to merge texture and image.")); + m_blendGain->setWhatsThis( i18n("<p>Set here the relief gain used to merge " + "texture and image.")); + // ------------------------------------------------------------- + + gridSettings->setMargin(spacingHint()); + gridSettings->setSpacing(spacingHint()); + gridSettings->addMultiCellWidget(label1, 0, 0, 0, 0); + gridSettings->addMultiCellWidget(m_textureType, 0, 0, 1, 1); gridSettings->addMultiCellWidget(label2, 1, 1, 0, 1); gridSettings->addMultiCellWidget(m_blendGain, 2, 2, 0, 1); @@ -150,7 +152,7 @@ KConfigGroup group = config->group("texture Tool Dialog"); m_textureType->blockSignals(true); m_blendGain->blockSignals(true); - m_textureType->setCurrentItem(group.readEntry("TextureType", (int)PaperTexture)); + m_textureType->setCurrentIndex(group.readEntry("TextureType", (int)PaperTexture)); m_blendGain->setValue(group.readEntry("BlendGain", 200)); m_textureType->blockSignals(false); m_blendGain->blockSignals(false); @@ -160,7 +162,7 @@ { KSharedConfig::Ptr config = KGlobal::config(); KConfigGroup group = config->group("texture Tool Dialog"); - group.writeEntry("TextureType", m_textureType->currentItem()); + group.writeEntry("TextureType", m_textureType->currentIndex()); group.writeEntry("BlendGain", m_blendGain->value()); group.sync(); } @@ -169,7 +171,7 @@ { m_textureType->blockSignals(true); m_blendGain->blockSignals(true); - m_textureType->setCurrentItem(PaperTexture); + m_textureType->setCurrentIndex(PaperTexture); m_blendGain->setValue(200); m_textureType->blockSignals(false); m_blendGain->blockSignals(false); @@ -181,7 +183,7 @@ m_blendGain->setEnabled(false); Digikam::DImg image = m_imagePreviewWidget->getOriginalRegionImage(); - QString texture = getTexturePath( m_textureType->currentItem() ); + QString texture = getTexturePath( m_textureType->currentIndex() ); int b = 255 - m_blendGain->value(); @@ -197,18 +199,18 @@ int b = 255 - m_blendGain->value(); Digikam::ImageIface iface(0, 0); - QString texture = getTexturePath( m_textureType->currentItem() ); + QString texture = getTexturePath( m_textureType->currentIndex() ); m_threadedFilter = dynamic_cast<Digikam::DImgThreadedFilter *>( new Texture(iface.getOriginalImg(), this, b, texture)); } -void ImageEffect_Texture::putPreviewData(void) +void ImageEffect_Texture::putPreviewData() { m_imagePreviewWidget->setPreviewImage(m_threadedFilter->getTargetImage()); } -void ImageEffect_Texture::putFinalData(void) +void ImageEffect_Texture::putFinalData() { Digikam::ImageIface iface(0, 0); iface.putOriginalImage(i18n("Texture"), m_threadedFilter->getTargetImage().bits()); @@ -219,7 +221,7 @@ QString pattern; switch (texture) - { + { case PaperTexture: pattern = "paper-texture"; break; @@ -283,12 +285,9 @@ case StoneTexture: pattern = "stone-texture"; break; - } + } - KGlobal::dirs()->addResourceType(pattern.ascii(), KGlobal::dirs()->kde_default("data") + - "digikam/data"); - return (KGlobal::dirs()->findResourceDir(pattern.ascii(), pattern + ".png") + pattern + ".png" ); + return (KStandardDirs::locate("data", QString("digikam/data/") + pattern + QString(".png"))); } } // NameSpace DigikamTextureImagesPlugin - --- trunk/extragear/graphics/digikam/imageplugins/texture/imageeffect_texture.h #683768:683769 @@ -27,7 +27,7 @@ // Qt includes. -#include <qstring.h> +#include <QString> // Digikam includes. --- trunk/extragear/graphics/digikam/imageplugins/texture/imageplugin_texture.cpp #683768:683769 @@ -46,8 +46,11 @@ m_textureAction = new KAction(KIcon("texture"), i18n("Apply Texture..."), this); actionCollection()->addAction("imageplugin_texture", m_textureAction ); - connect(m_textureAction, SIGNAL(triggered(bool) ), SLOT(slotTexture())); - setXMLFile( "digikamimageplugin_texture_ui.rc" ); + + connect(m_textureAction, SIGNAL(triggered(bool)), + this, SLOT(slotTexture())); + + setXMLFile( "digikamimageplugin_texture_ui.rc" ); DDebug() << "ImagePlugin_Texture plugin loaded" << endl; } @@ -66,4 +69,3 @@ DigikamTextureImagesPlugin::ImageEffect_Texture dlg(parentWidget()); dlg.exec(); } - --- trunk/extragear/graphics/digikam/imageplugins/texture/imageplugin_texture.h #683768:683769 @@ -37,8 +37,7 @@ public: - ImagePlugin_Texture(QObject *parent, - const QStringList &args); + ImagePlugin_Texture(QObject *parent, const QStringList &args); ~ImagePlugin_Texture(); void setEnabledActions(bool enable); --- trunk/extragear/graphics/digikam/imageplugins/texture/texture.h #683768:683769 @@ -27,7 +27,7 @@ // Qt includes. -#include <qstring.h> +#include <QString> // Digikam includes. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |