[Digikam-devel] extragear/graphics/digikam/imageplugins/charcoal

Gilles Caulier caulier.gilles at gmail.com
Thu Jul 5 11:17:40 BST 2007


SVN commit 683810 by cgilles:

digiKam from trunk: complete KDE4 port of Charcoal image plugin.
CCMAIL: digikam-devel at kde.org


 M  +10 -16    CMakeLists.txt  
 M  +13 -13    imageeffect_charcoal.cpp  
 M  +4 -3      imageplugin_charcoal.cpp  
 M  +1 -2      imageplugin_charcoal.h  


--- trunk/extragear/graphics/digikam/imageplugins/charcoal/CMakeLists.txt #683809:683810
@@ -1,22 +1,16 @@
 
-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_charcoal_PART_SRCS  imageplugin_charcoal.cpp
+                                           imageeffect_charcoal.cpp 
+                                           charcoal.cpp
+   )
 
+KDE4_AUTOMOC(${digikamimageplugin_charcoal_PART_SRCS})
 
-########### next target ###############
+KDE4_ADD_PLUGIN(digikamimageplugin_charcoal ${digikamimageplugin_charcoal_PART_SRCS})
 
-set(digikamimageplugin_charcoal_PART_SRCS  imageplugin_charcoal.cpp imageeffect_charcoal.cpp charcoal.cpp ${libdimg_SRCS})
+TARGET_LINK_LIBRARIES(digikamimageplugin_charcoal digikam)
 
-kde4_automoc(${digikamimageplugin_charcoal_PART_SRCS})
+INSTALL(TARGETS digikamimageplugin_charcoal DESTINATION ${PLUGIN_INSTALL_DIR})
 
-kde4_add_plugin(digikamimageplugin_charcoal ${digikamimageplugin_charcoal_PART_SRCS})
-
-target_link_libraries(digikamimageplugin_charcoal digikam)
-
-install(TARGETS digikamimageplugin_charcoal DESTINATION ${PLUGIN_INSTALL_DIR} )
-
-
-########### install files ###############
-
-install( FILES  digikamimageplugin_charcoal_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam )
-install( FILES  digikamimageplugin_charcoal.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
+INSTALL(FILES digikamimageplugin_charcoal_ui.rc DESTINATION ${DATA_INSTALL_DIR}/digikam)
+install(FILES digikamimageplugin_charcoal.desktop DESTINATION ${SERVICES_INSTALL_DIR})
--- trunk/extragear/graphics/digikam/imageplugins/charcoal/imageeffect_charcoal.cpp #683809:683810
@@ -24,12 +24,9 @@
 
 // Qt includes.
 
-#include <qlabel.h>
+#include <QLabel>
+#include <QGridLayout>
 
-#include <qlayout.h>
-//Added by qt3to4:
-#include <Q3GridLayout>
-
 // KDE includes.
 
 #include <kconfig.h>
@@ -79,17 +76,15 @@
     // -------------------------------------------------------------
     
     QWidget *gboxSettings     = new QWidget(m_imagePreviewWidget);
-    Q3GridLayout* gridSettings = new Q3GridLayout( gboxSettings, 3, 1, 0, spacingHint());
+    QGridLayout* gridSettings = new QGridLayout( gboxSettings );
+
     QLabel *label1 = new QLabel(i18n("Pencil size:"), gboxSettings);
     
-    m_pencilInput = new KIntNumInput(gboxSettings);
+    m_pencilInput  = new KIntNumInput(gboxSettings);
     m_pencilInput->setRange(1, 100, 1, true);  
     m_pencilInput->setValue(5);
     m_pencilInput->setWhatsThis( i18n("<p>Set here the charcoal pencil size used to simulate the drawing."));
 
-    gridSettings->addMultiCellWidget(label1, 0, 0, 0, 1);
-    gridSettings->addMultiCellWidget(m_pencilInput, 1, 1, 0, 1);
-    
     // -------------------------------------------------------------
     
     QLabel *label2 = new QLabel(i18n("Smooth:"), gboxSettings);
@@ -98,11 +93,17 @@
     m_smoothInput->setRange(1, 100, 1, true);  
     m_smoothInput->setValue(10);
     m_smoothInput->setWhatsThis( i18n("<p>This value controls the smoothing effect of the pencil "
-                                         "under the canvas."));
+                                      "under the canvas."));
 
+    // -------------------------------------------------------------
+
+    gridSettings->addMultiCellWidget(label1, 0, 0, 0, 1);
+    gridSettings->addMultiCellWidget(m_pencilInput, 1, 1, 0, 1);
     gridSettings->addMultiCellWidget(label2, 2, 2, 0, 1);
     gridSettings->addMultiCellWidget(m_smoothInput, 3, 3, 0, 1);
-    
+    gridSettings->setMargin(spacingHint());
+    gridSettings->setSpacing(spacingHint());
+
     m_imagePreviewWidget->setUserAreaWidget(gboxSettings);
     
     // -------------------------------------------------------------
@@ -193,4 +194,3 @@
 }
 
 }  // NameSpace DigikamCharcoalImagesPlugin
-
--- trunk/extragear/graphics/digikam/imageplugins/charcoal/imageplugin_charcoal.cpp #683809:683810
@@ -41,13 +41,14 @@
 K_EXPORT_COMPONENT_FACTORY(digikamimageplugin_charcoal,
                            KGenericFactory<ImagePlugin_Charcoal>("digikamimageplugin_charcoal"));
 
-ImagePlugin_Charcoal::ImagePlugin_Charcoal(QObject *parent,
-                                           const QStringList &)
+ImagePlugin_Charcoal::ImagePlugin_Charcoal(QObject *parent, const QStringList &)
                     : Digikam::ImagePlugin(parent, "ImagePlugin_Charcoal")
 {
     m_charcoalAction  = new KAction(KIcon("charcoaltool"), i18n("Charcoal Drawing..."), this);
     actionCollection()->addAction("",m_charcoalAction  );
-    connect(m_charcoalAction, SIGNAL(triggered(bool) ), SLOT(slotCharcoal()));
+
+    connect(m_charcoalAction, SIGNAL(triggered(bool)), 
+            this, SLOT(slotCharcoal()));
                 
     setXMLFile( "digikamimageplugin_charcoal_ui.rc" );
     
--- trunk/extragear/graphics/digikam/imageplugins/charcoal/imageplugin_charcoal.h #683809:683810
@@ -38,8 +38,7 @@
     
 public:
 
-    ImagePlugin_Charcoal(QObject *parent,
-                         const QStringList &args);
+    ImagePlugin_Charcoal(QObject *parent, const QStringList &args);
     ~ImagePlugin_Charcoal();
     
     void setEnabledActions(bool enable);



More information about the Digikam-devel mailing list