47
47
#include "contentawareresizetool.h"
48
#endif /* HAVE_GLIB2 */
48
#endif /* HAVE_GLIB2 */
50
50
using namespace DigikamTransformImagePlugin;
52
52
K_PLUGIN_FACTORY( TransformFactory, registerPlugin<ImagePlugin_Transform>(); )
53
53
K_EXPORT_PLUGIN ( TransformFactory("digikamimageplugin_transform") )
55
class ImagePlugin_Transform::ImagePlugin_TransformPriv
59
ImagePlugin_TransformPriv()
61
aspectRatioCropAction = 0;
63
contentAwareResizingAction = 0;
65
freerotationAction = 0;
66
perspectiveAction = 0;
69
KAction* aspectRatioCropAction;
70
KAction* resizeAction;
71
KAction* contentAwareResizingAction;
72
KAction* sheartoolAction;
73
KAction* freerotationAction;
74
KAction* perspectiveAction;
55
77
ImagePlugin_Transform::ImagePlugin_Transform(QObject* parent, const QVariantList&)
56
: ImagePlugin(parent, "ImagePlugin_Transform")
78
: ImagePlugin(parent, "ImagePlugin_Transform"),
79
d(new ImagePlugin_TransformPriv)
58
m_perspectiveAction = new KAction(KIcon("perspective"), i18n("Perspective Adjustment..."), this);
59
actionCollection()->addAction("imageplugin_perspective", m_perspectiveAction);
60
connect(m_perspectiveAction, SIGNAL(triggered(bool)),
81
d->perspectiveAction = new KAction(KIcon("perspective"), i18n("Perspective Adjustment..."), this);
82
actionCollection()->addAction("imageplugin_perspective", d->perspectiveAction);
83
connect(d->perspectiveAction, SIGNAL(triggered(bool)),
61
84
this, SLOT(slotPerspective()));
63
m_sheartoolAction = new KAction(KIcon("shear"), i18n("Shear..."), this);
64
actionCollection()->addAction("imageplugin_sheartool", m_sheartoolAction);
65
connect(m_sheartoolAction, SIGNAL(triggered(bool)),
86
d->sheartoolAction = new KAction(KIcon("shear"), i18n("Shear..."), this);
87
actionCollection()->addAction("imageplugin_sheartool", d->sheartoolAction);
88
connect(d->sheartoolAction, SIGNAL(triggered(bool)),
66
89
this, SLOT(slotShearTool()));
68
m_resizeAction = new KAction(KIcon("transform-scale"), i18n("&Resize..."), this);
69
actionCollection()->addAction("imageplugin_resize", m_resizeAction);
70
connect(m_resizeAction, SIGNAL(triggered()),
91
d->resizeAction = new KAction(KIcon("transform-scale"), i18n("&Resize..."), this);
92
actionCollection()->addAction("imageplugin_resize", d->resizeAction);
93
connect(d->resizeAction, SIGNAL(triggered()),
71
94
this, SLOT(slotResize()));
73
m_aspectRatioCropAction = new KAction(KIcon("ratiocrop"), i18n("Aspect Ratio Crop..."), this);
74
actionCollection()->addAction("imageplugin_ratiocrop", m_aspectRatioCropAction);
75
connect(m_aspectRatioCropAction, SIGNAL(triggered(bool) ),
76
this, SLOT(slotRatioCrop()));
96
d->aspectRatioCropAction = new KAction(KIcon("ratiocrop"), i18n("Aspect Ratio Crop..."), this);
97
actionCollection()->addAction("imageplugin_ratiocrop", d->aspectRatioCropAction);
98
connect(d->aspectRatioCropAction, SIGNAL(triggered(bool) ),
99
this, SLOT(slotRatioCrop()));
80
m_contentAwareResizingAction = new KAction(KIcon("transform-scale"), i18n("Liquid Rescale..."), this);
81
// m_contentAwareResizingAction->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_C));
82
actionCollection()->addAction("imageplugin_contentawareresizing", m_contentAwareResizingAction);
83
connect(m_contentAwareResizingAction, SIGNAL(triggered(bool)),
103
d->contentAwareResizingAction = new KAction(KIcon("transform-scale"), i18n("Liquid Rescale..."), this);
104
// d->contentAwareResizingAction->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_C));
105
actionCollection()->addAction("imageplugin_contentawareresizing", d->contentAwareResizingAction);
106
connect(d->contentAwareResizingAction, SIGNAL(triggered(bool)),
84
107
this, SLOT(slotContentAwareResizing()));
86
#endif /* HAVE_GLIB2 */
109
#endif /* HAVE_GLIB2 */
88
111
//-----------------------------------------------------------------------------------
90
113
QString pluginName(i18n("Free Rotation"));
92
115
// we want to have an actionCategory for this plugin (if possible), set a name for it
93
116
setActionCategory(pluginName);
95
m_freerotationAction = new KAction(KIcon("freerotation"), QString("%1...").arg(pluginName), this);
96
actionCollection()->addAction("imageplugin_freerotation", m_freerotationAction );
97
connect(m_freerotationAction, SIGNAL(triggered(bool) ),
118
d->freerotationAction = new KAction(KIcon("freerotation"), QString("%1...").arg(pluginName), this);
119
actionCollection()->addAction("imageplugin_freerotation", d->freerotationAction );
120
connect(d->freerotationAction, SIGNAL(triggered(bool) ),
98
121
this, SLOT(slotFreeRotation()));
100
123
KAction* point1Action = new KAction(i18n("Set Point 1"), this);