[krita] /: Remove the recorder
Boudewijn Rempt
null at kde.org
Thu Jun 21 10:02:33 UTC 2018
Git commit c8037eedc978a73d6b3ba60c138aa3a8883fe989 by Boudewijn Rempt.
Committed on 21/06/2018 at 09:53.
Pushed by rempt into branch 'master'.
Remove the recorder
We've been disabling this in releases since forwever because itr was
never even nearly finished: for instance, the wdgpaintactioneditor form
was never used anywhere, most tools didn't implement the special
recording code, all of our actions were never recorded.
A design where extra code has to be added in multiple places for every
single thing that we want to record isn't going to work.
If we want to do a recorder, we should start thinking about how we can
do this in a generic way, by having the UI generate xml or json that gets
recorded and executed: I guess we'd need to add some kind of interpreter
at the heart of Krita. But this is a dead end...
CCMAIL:kimageshop at kde.org
M +0 -7 krita/krita4.xmlgui
M +0 -52 krita/kritamenu.action
M +2 -17 libs/image/CMakeLists.txt
M +1 -1 libs/image/brushengine/kis_paintop_settings.h
M +0 -9 libs/image/kis_image.cc
M +0 -6 libs/image/kis_image.h
R +0 -0 libs/image/kis_node_query_path.cc [from: libs/image/recorder/kis_node_query_path.cc - 100% similarity]
R +0 -0 libs/image/kis_node_query_path.h [from: libs/image/recorder/kis_node_query_path.h - 100% similarity]
M +1 -1 libs/image/kis_spontaneous_job.h
D +0 -38 libs/image/recorder/kis_action_recorder.cc
D +0 -49 libs/image/recorder/kis_action_recorder.h
D +0 -132 libs/image/recorder/kis_macro.cc
D +0 -75 libs/image/recorder/kis_macro.h
D +0 -108 libs/image/recorder/kis_macro_player.cc
D +0 -49 libs/image/recorder/kis_macro_player.h
D +0 -65 libs/image/recorder/kis_play_info.cc
D +0 -42 libs/image/recorder/kis_play_info.h
D +0 -94 libs/image/recorder/kis_recorded_action.cc
D +0 -77 libs/image/recorder/kis_recorded_action.h
D +0 -51 libs/image/recorder/kis_recorded_action_factory_registry.cc
D +0 -36 libs/image/recorder/kis_recorded_action_factory_registry.h
D +0 -24 libs/image/recorder/kis_recorded_action_load_context.cpp
D +0 -35 libs/image/recorder/kis_recorded_action_load_context.h
D +0 -23 libs/image/recorder/kis_recorded_action_save_context.cpp
D +0 -34 libs/image/recorder/kis_recorded_action_save_context.h
D +0 -117 libs/image/recorder/kis_recorded_fill_paint_action.cpp
D +0 -65 libs/image/recorder/kis_recorded_fill_paint_action.h
D +0 -175 libs/image/recorder/kis_recorded_filter_action.cpp
D +0 -64 libs/image/recorder/kis_recorded_filter_action.h
D +0 -75 libs/image/recorder/kis_recorded_node_action.cc
D +0 -51 libs/image/recorder/kis_recorded_node_action.h
D +0 -467 libs/image/recorder/kis_recorded_paint_action.cpp
D +0 -110 libs/image/recorder/kis_recorded_paint_action.h
D +0 -292 libs/image/recorder/kis_recorded_path_paint_action.cpp
D +0 -87 libs/image/recorder/kis_recorded_path_paint_action.h
D +0 -169 libs/image/recorder/kis_recorded_shape_paint_action.cpp
D +0 -72 libs/image/recorder/kis_recorded_shape_paint_action.h
M +1 -5 libs/image/tests/CMakeLists.txt
D +0 -62 libs/image/tests/kis_macro_test.cpp
D +0 -33 libs/image/tests/kis_macro_test.h
M +1 -1 libs/image/tests/kis_node_query_path_test.cpp
D +0 -30 libs/image/tests/kis_recorded_action_factory_registry_test.cpp
D +0 -33 libs/image/tests/kis_recorded_action_factory_registry_test.h
D +0 -50 libs/image/tests/kis_recorded_action_test.cpp
D +0 -33 libs/image/tests/kis_recorded_action_test.h
D +0 -45 libs/image/tests/kis_recorded_filter_action_test.cpp
D +0 -33 libs/image/tests/kis_recorded_filter_action_test.h
M +0 -5 libs/koplugin/KisMimeDatabase.cpp
M +0 -1 libs/pigment/KoColorSpaceRegistry.h
M +0 -11 libs/ui/CMakeLists.txt
D +0 -207 libs/ui/forms/wdgpaintactioneditor.ui
M +0 -1 libs/ui/kis_selection_manager.cc
D +0 -95 libs/ui/recorder/kis_node_query_path_editor.cc
D +0 -50 libs/ui/recorder/kis_node_query_path_editor.h
D +0 -31 libs/ui/recorder/kis_recorded_action_creator.cc
D +0 -39 libs/ui/recorder/kis_recorded_action_creator.h
D +0 -59 libs/ui/recorder/kis_recorded_action_creator_factory.cc
D +0 -56 libs/ui/recorder/kis_recorded_action_creator_factory.h
D +0 -72 libs/ui/recorder/kis_recorded_action_creator_factory_registry.cc
D +0 -55 libs/ui/recorder/kis_recorded_action_creator_factory_registry.h
D +0 -32 libs/ui/recorder/kis_recorded_action_editor_factory.cc
D +0 -50 libs/ui/recorder/kis_recorded_action_editor_factory.h
D +0 -83 libs/ui/recorder/kis_recorded_action_editor_factory_registry.cc
D +0 -58 libs/ui/recorder/kis_recorded_action_editor_factory_registry.h
D +0 -77 libs/ui/recorder/kis_recorded_filter_action_creator.cpp
D +0 -50 libs/ui/recorder/kis_recorded_filter_action_creator.h
D +0 -97 libs/ui/recorder/kis_recorded_filter_action_editor.cc
D +0 -57 libs/ui/recorder/kis_recorded_filter_action_editor.h
D +0 -158 libs/ui/recorder/kis_recorded_paint_action_editor.cc
D +0 -68 libs/ui/recorder/kis_recorded_paint_action_editor.h
M +0 -1 libs/ui/tests/CMakeLists.txt
D +0 -49 libs/ui/tests/kis_recorded_action_editor_test.cpp
D +0 -31 libs/ui/tests/kis_recorded_action_editor_test.h
D +0 -87 libs/ui/tool/kis_recording_adapter.cpp
D +0 -54 libs/ui/tool/kis_recording_adapter.h
M +0 -19 libs/ui/tool/kis_resources_snapshot.cpp
M +1 -6 libs/ui/tool/kis_resources_snapshot.h
M +0 -7 libs/ui/tool/kis_tool.cc
M +0 -3 libs/ui/tool/kis_tool.h
M +2 -11 libs/ui/tool/kis_tool_freehand.cc
M +0 -5 libs/ui/tool/kis_tool_freehand.h
M +0 -25 libs/ui/tool/kis_tool_freehand_helper.cpp
M +0 -2 libs/ui/tool/kis_tool_freehand_helper.h
M +11 -12 libs/ui/tool/kis_tool_multihand_helper.cpp
M +1 -2 libs/ui/tool/kis_tool_multihand_helper.h
M +0 -11 libs/ui/tool/kis_tool_paint.cc
M +0 -2 libs/ui/tool/kis_tool_paint.h
M +1 -54 libs/ui/tool/kis_tool_shape.cc
M +0 -2 libs/ui/tool/kis_tool_shape.h
M +0 -1 plugins/extensions/CMakeLists.txt
D +0 -13 plugins/extensions/bigbrother/CMakeLists.txt
D +0 -199 plugins/extensions/bigbrother/actionseditor/kis_actions_editor.cpp
D +0 -61 plugins/extensions/bigbrother/actionseditor/kis_actions_editor.h
D +0 -41 plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.cpp
D +0 -37 plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.h
D +0 -122 plugins/extensions/bigbrother/actionseditor/kis_macro_model.cpp
D +0 -47 plugins/extensions/bigbrother/actionseditor/kis_macro_model.h
D +0 -197 plugins/extensions/bigbrother/actionseditor/wdgactionseditor.ui
D +0 -235 plugins/extensions/bigbrother/bigbrother.cc
D +0 -52 plugins/extensions/bigbrother/bigbrother.h
D +0 -15 plugins/extensions/bigbrother/bigbrother.xmlgui
D +0 -10 plugins/extensions/bigbrother/kritabigbrother.json
M +0 -11 plugins/tools/basictools/kis_tool_ellipse.cc
M +0 -20 plugins/tools/basictools/kis_tool_fill.cc
M +1 -8 plugins/tools/basictools/kis_tool_line.cc
M +1 -3 plugins/tools/basictools/kis_tool_line_helper.cpp
M +1 -2 plugins/tools/basictools/kis_tool_line_helper.h
M +1 -2 plugins/tools/basictools/kis_tool_multihand.cpp
M +0 -10 plugins/tools/basictools/kis_tool_rectangle.cc
M +0 -15 plugins/tools/tool_polygon/kis_tool_polygon.cc
M +0 -14 plugins/tools/tool_polyline/kis_tool_polyline.cc
https://commits.kde.org/krita/c8037eedc978a73d6b3ba60c138aa3a8883fe989
diff --git a/krita/krita4.xmlgui b/krita/krita4.xmlgui
index 907ebfe3265..7c29c0e666a 100644
--- a/krita/krita4.xmlgui
+++ b/krita/krita4.xmlgui
@@ -311,13 +311,6 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Menu name="tools">
<text>&Tools</text>
<Menu name="scripts"><text>Scripts</text></Menu>
- <Menu name="Macro Recording">
- <text>Macros</text>
- <Action name="Recording_Start_Recording_Macro"/>
- <Action name="Recording_Stop_Recording_Macro"/>
- <Action name="Macro_Open_Play"/>
- <Action name="Macro_Open_Edit"/>
- </Menu>
</Menu>
<Menu name="settings">
<text>Setti&ngs</text>
diff --git a/krita/kritamenu.action b/krita/kritamenu.action
index 151a10df76a..22e8e1e24da 100644
--- a/krita/kritamenu.action
+++ b/krita/kritamenu.action
@@ -1495,58 +1495,6 @@
</Action>
</Actions>
- <Actions category="Tools">
- <text>Tools</text>
- <Action name="Recording_Start_Recording_Macro">
- <icon>media-record</icon>
- <text>&Start recording macro</text>
- <whatsThis></whatsThis>
- <toolTip>Start recording macro</toolTip>
- <iconText>Start recording macro</iconText>
- <activationFlags>1000</activationFlags>
- <activationConditions>0</activationConditions>
- <shortcut></shortcut>
- <isCheckable>false</isCheckable>
- <statusTip></statusTip>
- </Action>
- <Action name="Recording_Stop_Recording_Macro">
- <icon>media-playback-stop</icon>
- <text>Stop &recording macro</text>
- <whatsThis></whatsThis>
- <toolTip>Stop recording macro</toolTip>
- <iconText>Stop recording macro</iconText>
- <activationFlags>1000</activationFlags>
- <activationConditions>0</activationConditions>
- <shortcut></shortcut>
- <isCheckable>false</isCheckable>
- <statusTip></statusTip>
- </Action>
- <Action name="Macro_Open_Play">
- <icon>media-playback-start</icon>
- <text>&Open and play...</text>
- <whatsThis></whatsThis>
- <toolTip>Open and play</toolTip>
- <iconText>Open and play</iconText>
- <activationFlags>0</activationFlags>
- <activationConditions>0</activationConditions>
- <shortcut></shortcut>
- <isCheckable>false</isCheckable>
- <statusTip></statusTip>
- </Action>
- <Action name="Macro_Open_Edit">
- <icon>document-edit</icon>
- <text>Open &and edit...</text>
- <whatsThis></whatsThis>
- <toolTip>Open and edit</toolTip>
- <iconText>Open and edit</iconText>
- <activationFlags>0</activationFlags>
- <activationConditions>0</activationConditions>
- <shortcut></shortcut>
- <isCheckable>false</isCheckable>
- <statusTip></statusTip>
- </Action>
- </Actions>
-
<Actions category="Settings">
<text>Settings</text>
<Action name="options_configure">
diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt
index d20f437daa5..f72d83badff 100644
--- a/libs/image/CMakeLists.txt
+++ b/libs/image/CMakeLists.txt
@@ -14,7 +14,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/generator
${CMAKE_CURRENT_SOURCE_DIR}/layerstyles
${CMAKE_CURRENT_SOURCE_DIR}/processing
- ${CMAKE_CURRENT_SOURCE_DIR}/recorder
${CMAKE_SOURCE_DIR}/sdk/tests
)
@@ -286,21 +285,6 @@ set(kritaimage_LIB_SRCS
metadata/kis_meta_data_type_info.cc
metadata/kis_meta_data_validator.cc
metadata/kis_meta_data_value.cc
- recorder/kis_action_recorder.cc
- recorder/kis_macro.cc
- recorder/kis_macro_player.cc
- recorder/kis_node_query_path.cc
- recorder/kis_play_info.cc
- recorder/kis_recorded_action.cc
- recorder/kis_recorded_action_factory_registry.cc
- recorder/kis_recorded_action_load_context.cpp
- recorder/kis_recorded_action_save_context.cpp
- recorder/kis_recorded_filter_action.cpp
- recorder/kis_recorded_fill_paint_action.cpp
- recorder/kis_recorded_node_action.cc
- recorder/kis_recorded_paint_action.cpp
- recorder/kis_recorded_path_paint_action.cpp
- recorder/kis_recorded_shape_paint_action.cpp
kis_keyframe.cpp
kis_keyframe_channel.cpp
@@ -328,6 +312,8 @@ set(kritaimage_LIB_SRCS
layerstyles/gimp_bump_map.cpp
KisProofingConfiguration.cpp
+
+ kis_node_query_path.cc
)
set(einspline_SRCS
@@ -381,7 +367,6 @@ target_include_directories(kritaimage
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/layerstyles>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/metadata>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/processing>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/recorder>
)
set_target_properties(kritaimage PROPERTIES
diff --git a/libs/image/brushengine/kis_paintop_settings.h b/libs/image/brushengine/kis_paintop_settings.h
index d820f5bcce1..14c39bbf897 100644
--- a/libs/image/brushengine/kis_paintop_settings.h
+++ b/libs/image/brushengine/kis_paintop_settings.h
@@ -61,7 +61,7 @@ const QString SPACING_USE_UPDATES = "PaintOpSettings/updateSpacingBetweenDabs";
* between two creations. There is one KisPaintOpSettings per input device (mouse, tablet,
* etc...).
*
- * The settings may be stored in a preset or a recorded brush stroke. Note that if your
+ * The settings may be stored in a preset. Note that if your
* paintop's settings subclass has data that is not stored as a property, that data is not
* saved and restored.
*
diff --git a/libs/image/kis_image.cc b/libs/image/kis_image.cc
index 51be3f46df2..fa5415f8918 100644
--- a/libs/image/kis_image.cc
+++ b/libs/image/kis_image.cc
@@ -40,7 +40,6 @@
#include <KoCompositeOpRegistry.h>
#include "KisProofingConfiguration.h"
-#include "recorder/kis_action_recorder.h"
#include "kis_adjustment_layer.h"
#include "kis_annotation.h"
#include "kis_change_profile_visitor.h"
@@ -140,7 +139,6 @@ public:
, undoStore(undo ? undo : new KisDumbUndoStore())
, legacyUndoAdapter(undoStore.data(), _q)
, postExecutionUndoAdapter(undoStore.data(), _q)
- , recorder(_q)
, signalRouter(_q)
, animationInterface(_animationInterface)
, scheduler(_q, _q)
@@ -217,8 +215,6 @@ public:
KisLegacyUndoAdapter legacyUndoAdapter;
KisPostExecutionUndoAdapter postExecutionUndoAdapter;
- KisActionRecorder recorder;
-
vKisAnnotationSP annotations;
QAtomicInt disableUIUpdateSignals;
@@ -1155,11 +1151,6 @@ KisUndoAdapter* KisImage::undoAdapter() const
return &m_d->legacyUndoAdapter;
}
-KisActionRecorder* KisImage::actionRecorder() const
-{
- return &m_d->recorder;
-}
-
void KisImage::setDefaultProjectionColor(const KoColor &color)
{
KIS_ASSERT_RECOVER_RETURN(m_d->rootLayer);
diff --git a/libs/image/kis_image.h b/libs/image/kis_image.h
index 240ffbc2d76..fcea5fd28a1 100644
--- a/libs/image/kis_image.h
+++ b/libs/image/kis_image.h
@@ -43,7 +43,6 @@ class KoColorSpace;
class KoColor;
class KisCompositeProgressProxy;
-class KisActionRecorder;
class KisUndoStore;
class KisUndoAdapter;
class KisImageSignalRouter;
@@ -388,11 +387,6 @@ public:
*/
KisUndoStore* undoStore();
- /**
- * @return the action recorder associated with this image
- */
- KisActionRecorder* actionRecorder() const;
-
/**
* Tell the image it's modified; this emits the sigImageModified
* signal. This happens when the image needs to be saved
diff --git a/libs/image/recorder/kis_node_query_path.cc b/libs/image/kis_node_query_path.cc
similarity index 100%
rename from libs/image/recorder/kis_node_query_path.cc
rename to libs/image/kis_node_query_path.cc
diff --git a/libs/image/recorder/kis_node_query_path.h b/libs/image/kis_node_query_path.h
similarity index 100%
rename from libs/image/recorder/kis_node_query_path.h
rename to libs/image/kis_node_query_path.h
diff --git a/libs/image/kis_spontaneous_job.h b/libs/image/kis_spontaneous_job.h
index 6a4194062d6..033eac24e6a 100644
--- a/libs/image/kis_spontaneous_job.h
+++ b/libs/image/kis_spontaneous_job.h
@@ -24,7 +24,7 @@
/**
* This class represents a simple update just that should be
* executed by the updates system from time to time, without
- * any recording or undo support. Just some useful update that
+ * any undo support. Just some useful update that
* can be run concurrently with other types updates.
*/
class KRITAIMAGE_EXPORT KisSpontaneousJob : public KisRunnable
diff --git a/libs/image/recorder/kis_action_recorder.cc b/libs/image/recorder/kis_action_recorder.cc
deleted file mode 100644
index a0cf36bca32..00000000000
--- a/libs/image/recorder/kis_action_recorder.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "recorder/kis_action_recorder.h"
-
-#include "recorder/kis_recorded_action.h"
-
-KisActionRecorder::KisActionRecorder(QObject* parent)
- : QObject(parent)
-{
-
-}
-
-KisActionRecorder::~KisActionRecorder()
-{
-}
-
-void KisActionRecorder::addAction(const KisRecordedAction& action, const KisRecordedAction* before)
-{
- Q_UNUSED(before);
- emit(addedAction(action));
-}
-
diff --git a/libs/image/recorder/kis_action_recorder.h b/libs/image/recorder/kis_action_recorder.h
deleted file mode 100644
index c4fbba629fe..00000000000
--- a/libs/image/recorder/kis_action_recorder.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_ACTION_RECORDER_H_
-#define _KIS_ACTION_RECORDER_H_
-
-#include <QObject>
-#include "kritaimage_export.h"
-
-class KisRecordedAction;
-
-/**
- * This class allows other \ref KisMacro to connect to it
- * to get the action that are currently created.
- */
-class KRITAIMAGE_EXPORT KisActionRecorder : public QObject
-{
- Q_OBJECT
-public:
- KisActionRecorder(QObject* parent = 0);
- ~KisActionRecorder() override;
-
-public Q_SLOTS:
-
- void addAction(const KisRecordedAction& action, const KisRecordedAction* before = 0);
-
-Q_SIGNALS:
- /**
- * This signal is emitted each time an action is added to this recorder.
- */
- void addedAction(const KisRecordedAction& action);
-};
-
-#endif
diff --git a/libs/image/recorder/kis_macro.cc b/libs/image/recorder/kis_macro.cc
deleted file mode 100644
index 84e0ee3554b..00000000000
--- a/libs/image/recorder/kis_macro.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_macro.h"
-#include <QDomNode>
-
-#include <kis_debug.h>
-#include <klocalizedstring.h>
-
-#include "kis_image.h"
-#include "recorder/kis_recorded_action.h"
-#include "recorder/kis_recorded_action_factory_registry.h"
-#include "kis_undo_adapter.h"
-#include "kis_play_info.h"
-#include "kis_node_query_path.h"
-#include <kis_paint_device.h>
-
-struct Q_DECL_HIDDEN KisMacro::Private {
- QList<KisRecordedAction*> actions;
-};
-
-KisMacro::KisMacro(QObject* parent) : QObject(parent), d(new Private)
-{
-}
-
-KisMacro::KisMacro(const QList<KisRecordedAction*>& actions) : d(new Private)
-{
- appendActions(actions);
-}
-
-KisMacro::~KisMacro()
-{
- qDeleteAll(d->actions);
- delete d;
-}
-
-
-void KisMacro::appendActions(const QList<KisRecordedAction*>& actions)
-{
- Q_FOREACH (KisRecordedAction* action, actions) {
- addAction(*action);
- }
-}
-
-void KisMacro::removeActions(const QList<KisRecordedAction*>& actions)
-{
- Q_FOREACH (KisRecordedAction* action, actions) {
- d->actions.removeAll(action);
- }
- qDeleteAll(actions);
-}
-
-void KisMacro::addAction(const KisRecordedAction& action, const KisRecordedAction* before)
-{
- if (before == 0) {
- KisRecordedAction* a = action.clone();
- Q_ASSERT(a);
- d->actions.append(a);
- } else {
- d->actions.insert(d->actions.indexOf(const_cast<KisRecordedAction*>(before)), action.clone());
- }
-}
-
-void KisMacro::moveAction(const KisRecordedAction* action, const KisRecordedAction* before)
-{
- KisRecordedAction* _action = d->actions.takeAt(d->actions.indexOf(const_cast<KisRecordedAction*>(action)));
- if (before == 0) {
- Q_ASSERT(_action);
- d->actions.append(_action);
- } else {
- d->actions.insert(d->actions.indexOf(const_cast<KisRecordedAction*>(before)), _action);
- }
-}
-
-void KisMacro::fromXML(const QDomElement& docElem, const KisRecordedActionLoadContext* loadContext)
-{
- d->actions.clear();
- QDomNode node = docElem.firstChild();
- while (!node.isNull()) {
- QDomElement elt = node.toElement(); // try to convert the node to an element.
- if (!elt.isNull() && elt.tagName() == "RecordedAction") {
- QString id = elt.attribute("id", "");
- if (!id.isNull()) {
- dbgImage << "Reconstruct : " << id << endl; // the node really is an element.
- KisRecordedActionFactory* raf = KisRecordedActionFactoryRegistry::instance()->get(id);
- if (raf) {
- KisRecordedAction* a = raf->fromXML(elt, loadContext);
- Q_ASSERT(a);
- d->actions.append(a); // TODO should use addAction
- } else {
- dbgImage << "Unknown action : " << id << endl;
- }
- } else {
- dbgImage << "Invalid recorded action: null id";
- }
- } else {
- dbgImage << "Unknown element " << elt.tagName() << (elt.tagName() == "RecordedAction");
- }
- node = node.nextSibling();
- }
-}
-
-void KisMacro::toXML(QDomDocument& doc, QDomElement& e, KisRecordedActionSaveContext* saveContext) const
-{
- for (QList<KisRecordedAction*>::iterator it = d->actions.begin();
- it != d->actions.end(); ++it) {
- QDomElement eAct = doc.createElement("RecordedAction");
- (*it)->toXML(doc, eAct, saveContext);
- e.appendChild(eAct);
- }
-}
-
-const QList<KisRecordedAction*>& KisMacro::actions() const
-{
- return d->actions;
-}
-
diff --git a/libs/image/recorder/kis_macro.h b/libs/image/recorder/kis_macro.h
deleted file mode 100644
index 3f904abd4c0..00000000000
--- a/libs/image/recorder/kis_macro.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_MACRO_H_
-#define _KIS_MACRO_H_
-
-#include <QList>
-#include <QObject>
-#include <kritaimage_export.h>
-
-#include "kis_serializable_configuration.h"
-#include "kis_types.h"
-
-class KisRecordedAction;
-class KisRecordedActionLoadContext;
-class KisRecordedActionSaveContext;
-
-/**
- * This is the base class for macro in Krita. It's basically a list of recorded action,KisRecordedAction
- * that can be stored as XML, played, and edited.
- */
-class KRITAIMAGE_EXPORT KisMacro : public QObject
-{
- Q_OBJECT
-public:
- KisMacro(QObject* parent = 0);
- KisMacro(const QList<KisRecordedAction*>& _actions);
- ~KisMacro() override;
-public:
- /**
- * Append a list of actions, and make clone of them.
- */
- void appendActions(const QList<KisRecordedAction*>& actions);
- /**
- * Remove the list of actions. Actions are deleted.
- */
- void removeActions(const QList<KisRecordedAction*>& actions);
- /**
- * Move the action before an other one.
- * @param before if null, the action is moved to the end
- */
- void moveAction(const KisRecordedAction* action, const KisRecordedAction* before);
-public: // serialization functions
-
- virtual void fromXML(const QDomElement&, const KisRecordedActionLoadContext* loadContext);
- virtual void toXML(QDomDocument& doc, QDomElement& e, KisRecordedActionSaveContext* saveContext) const;
- const QList<KisRecordedAction*>& actions() const;
-public Q_SLOTS:
- /**
- * add a single action, and make a clone of it.
- * @param before if non null, the action will be added before that action,
- * otherwise, if null, the action will be added at the end.
- */
- virtual void addAction(const KisRecordedAction& action, const KisRecordedAction* before = 0);
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_macro_player.cc b/libs/image/recorder/kis_macro_player.cc
deleted file mode 100644
index 7490b93e8da..00000000000
--- a/libs/image/recorder/kis_macro_player.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2007,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_macro_player.h"
-
-#include <klocalizedstring.h>
-
-#include <KoProgressUpdater.h>
-#include <KoUpdater.h>
-
-#include "kis_image.h"
-#include "kis_debug.h"
-#include "kis_macro.h"
-#include "kis_node_query_path.h"
-#include "kis_play_info.h"
-#include "kis_recorded_action.h"
-#include "kis_undo_adapter.h"
-#include "kundo2magicstring.h"
-
-
-struct Q_DECL_HIDDEN KisMacroPlayer::Private
-{
- Private(const KisPlayInfo& _info) : info(_info), updater(0) {}
- bool paused;
- KisMacro* macro;
- KisPlayInfo info;
- KoUpdater* updater;
-};
-
-KisMacroPlayer::KisMacroPlayer(KisMacro* _macro, const KisPlayInfo& info, KoUpdater * updater, QObject* _parent ) : QThread(_parent), d(new Private(info))
-{
- d->macro = _macro;
- d->updater = updater;
-}
-
-KisMacroPlayer::~KisMacroPlayer()
-{
- delete d;
-}
-
-void KisMacroPlayer::pause()
-{
- d->paused = true;
-}
-
-void KisMacroPlayer::resume()
-{
- d->paused = false;
-}
-
-void KisMacroPlayer::run()
-{
- d->paused = false;
- QList<KisRecordedAction*> actions = d->macro->actions();
-
- if (actions.size() < 1) {
- return;
- }
-
- dbgImage << "Start playing macro with " << actions.size() << " actions";
- if (d->info.undoAdapter()) {
- d->info.undoAdapter()->beginMacro(kundo2_i18n("Play macro"));
- }
-
- KoProgressUpdater* progressUpdater = 0;
- if(d->updater) {
- progressUpdater = new KoProgressUpdater(d->updater);
- progressUpdater->start(actions.size(), i18n("Playing back macro"));
- }
-
- for (QList<KisRecordedAction*>::iterator it = actions.begin(); it != actions.end(); ++it) {
- if (*it) {
- dbgImage << "Play action : " << (*it)->name();
- KoUpdater* updater = 0;
- if(progressUpdater) {
- updater = progressUpdater->startSubtask();
- }
- (*it)->play(d->info, updater);
- }
- if(progressUpdater && progressUpdater->interrupted()) {
- break;
- }
- }
-
- if (d->info.undoAdapter()) {
- d->info.undoAdapter()->endMacro();
- if(progressUpdater && progressUpdater->interrupted()) {
- d->info.undoAdapter()->undoLastCommand();
- }
- }
-
-}
-
diff --git a/libs/image/recorder/kis_macro_player.h b/libs/image/recorder/kis_macro_player.h
deleted file mode 100644
index c58cafc0642..00000000000
--- a/libs/image/recorder/kis_macro_player.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_MACRO_PLAYER_H_
-#define _KIS_MACRO_PLAYER_H_
-
-#include <QThread>
-
-#include <kritaimage_export.h>
-#include <kis_paint_device.h>
-
-class KisMacro;
-class KisPlayInfo;
-class KoUpdater;
-
-/**
- * This class play a macro inside a thread.
- */
-class KRITAIMAGE_EXPORT KisMacroPlayer : public QThread {
- Q_OBJECT
-public:
- KisMacroPlayer(KisMacro* _macro, const KisPlayInfo& info, KoUpdater * updater = 0, QObject* _parent = 0);
- ~KisMacroPlayer() override;
-public Q_SLOTS:
- void pause();
- void resume();
-protected:
- void run() override;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_play_info.cc b/libs/image/recorder/kis_play_info.cc
deleted file mode 100644
index a0d40d8aad5..00000000000
--- a/libs/image/recorder/kis_play_info.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_play_info.h"
-
-#include "kis_image.h"
-#include "kis_node.h"
-#include <kis_paint_device.h>
-
-struct Q_DECL_HIDDEN KisPlayInfo::Private {
- KisImageWSP image;
- KisNodeSP currentNode;
-};
-
-KisPlayInfo::KisPlayInfo(KisImageWSP image, KisNodeSP currentNode)
- : d(new Private)
-{
- d->image = image;
- d->currentNode = currentNode;
-}
-
-KisPlayInfo::KisPlayInfo(const KisPlayInfo& _rhs) : d(new Private(*_rhs.d))
-{
-}
-
-KisPlayInfo& KisPlayInfo::operator=(const KisPlayInfo& _rhs)
-{
- *d = *_rhs.d;
- return *this;
-}
-
-KisPlayInfo::~KisPlayInfo()
-{
- delete d;
-}
-
-KisUndoAdapter* KisPlayInfo::undoAdapter() const
-{
- return d->image->undoAdapter();
-}
-
-KisImageWSP KisPlayInfo::image() const
-{
- return d->image;
-}
-
-KisNodeSP KisPlayInfo::currentNode() const
-{
- return d->currentNode;
-}
diff --git a/libs/image/recorder/kis_play_info.h b/libs/image/recorder/kis_play_info.h
deleted file mode 100644
index 9f54df938e0..00000000000
--- a/libs/image/recorder/kis_play_info.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_PLAY_INFO_H_
-#define _KIS_PLAY_INFO_H_
-
-#include <kis_types.h>
-#include <kritaimage_export.h>
-
-class KisUndoAdapter;
-
-class KRITAIMAGE_EXPORT KisPlayInfo
-{
-public:
- KisPlayInfo(KisImageWSP image, KisNodeSP currentNodes);
- KisPlayInfo(const KisPlayInfo& _rhs);
- KisPlayInfo& operator=(const KisPlayInfo& _rhs);
- ~KisPlayInfo();
- KisUndoAdapter* undoAdapter() const;
- KisImageWSP image() const;
- KisNodeSP currentNode() const;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action.cc b/libs/image/recorder/kis_recorded_action.cc
deleted file mode 100644
index 5b5ae388c50..00000000000
--- a/libs/image/recorder/kis_recorded_action.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action.h"
-#include <QDomDocument>
-#include <QDomElement>
-#include <QString>
-
-#include <kis_image.h>
-#include <kis_node.h>
-#include <kis_layer.h>
-#include <kis_group_layer.h>
-#include <kis_paint_device.h>
-
-struct Q_DECL_HIDDEN KisRecordedAction::Private {
- QString name;
- QString id;
-};
-
-KisRecordedAction::KisRecordedAction(const QString& id, const QString& name) : d(new Private())
-{
- d->name = name;
- d->id = id;
-}
-
-KisRecordedAction::KisRecordedAction(const KisRecordedAction& rhs) : d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedAction::~KisRecordedAction()
-{
- delete d;
-}
-
-const QString& KisRecordedAction::id() const
-{
- return d->id;
-}
-
-const QString& KisRecordedAction::name() const
-{
- return d->name;
-}
-
-void KisRecordedAction::setName(const QString& name)
-{
- d->name = name;
-}
-
-void KisRecordedAction::toXML(QDomDocument& , QDomElement& elt, KisRecordedActionSaveContext* ) const
-{
- elt.setAttribute("name", name());
- elt.setAttribute("id", id());
-}
-
-struct Q_DECL_HIDDEN KisRecordedActionFactory::Private {
- QString id;
-};
-
-KisRecordedActionFactory::KisRecordedActionFactory(QString id) : d(new Private)
-{
- d->id = id;
-}
-
-KisRecordedActionFactory::~KisRecordedActionFactory()
-{
- delete d;
-}
-
-QString KisRecordedActionFactory::id() const
-{
- return d->id;
-}
-
-QString KisRecordedActionFactory::name() const
-{
- return QString();
-}
diff --git a/libs/image/recorder/kis_recorded_action.h b/libs/image/recorder/kis_recorded_action.h
deleted file mode 100644
index 6285be090bc..00000000000
--- a/libs/image/recorder/kis_recorded_action.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_H_
-#define _KIS_RECORDED_ACTION_H_
-
-class QDomDocument;
-class QDomElement;
-class QString;
-class KisPlayInfo;
-class KisRecordedActionLoadContext;
-class KisRecordedActionSaveContext;
-class KoUpdater;
-
-#include <kritaimage_export.h>
-#include <kis_filter_configuration.h>
-#include <kis_types.h>
-
-/**
- * This class represent an action.
- */
-class KRITAIMAGE_EXPORT KisRecordedAction
-{
-public:
- KisRecordedAction(const QString& id, const QString& name);
- KisRecordedAction(const KisRecordedAction&);
- virtual ~KisRecordedAction();
- /**
- * Play the action.
- */
- virtual void play(const KisPlayInfo& _info, KoUpdater* _updater = 0) const = 0;
- /**
- * Clone this action.
- */
- virtual KisRecordedAction* clone() const = 0;
- virtual void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const;
-public:
- const QString& id() const;
- const QString& name() const;
- void setName(const QString& name);
-private:
- struct Private;
- Private* const d;
-};
-
-/**
- * This class is used to create recorded action.
- */
-class KRITAIMAGE_EXPORT KisRecordedActionFactory
-{
-public:
- KisRecordedActionFactory(QString id);
- virtual ~KisRecordedActionFactory();
- virtual KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*) = 0;
- QString id() const;
- QString name() const;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action_factory_registry.cc b/libs/image/recorder/kis_recorded_action_factory_registry.cc
deleted file mode 100644
index b1d17cc41c8..00000000000
--- a/libs/image/recorder/kis_recorded_action_factory_registry.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_factory_registry.h"
-#include "kis_recorded_filter_action.h"
-#include "kis_recorded_path_paint_action.h"
-#include "kis_recorded_shape_paint_action.h"
-#include "kis_recorded_fill_paint_action.h"
-
-#include <QGlobalStatic>
-#include <kis_debug.h>
-
-Q_GLOBAL_STATIC(KisRecordedActionFactoryRegistry, s_instance)
-
-
-KisRecordedActionFactoryRegistry* KisRecordedActionFactoryRegistry::instance()
-{
- return s_instance;
-}
-
-
-KisRecordedActionFactoryRegistry::KisRecordedActionFactoryRegistry()
-{
- add(new KisRecordedFilterActionFactory);
- add(new KisRecordedPathPaintActionFactory);
- add(new KisRecordedShapePaintActionFactory);
- add(new KisRecordedFillPaintActionFactory);
-}
-
-KisRecordedActionFactoryRegistry::~KisRecordedActionFactoryRegistry()
-{
- Q_FOREACH (const QString &id, keys()) {
- delete get(id);
- }
- dbgRegistry << "deleting KisRecordedActionFactoryRegistry";
-}
diff --git a/libs/image/recorder/kis_recorded_action_factory_registry.h b/libs/image/recorder/kis_recorded_action_factory_registry.h
deleted file mode 100644
index b6784172204..00000000000
--- a/libs/image/recorder/kis_recorded_action_factory_registry.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_FACTORY_REGISTRY_H_
-
-#include <KoGenericRegistry.h>
-
-class KisRecordedActionFactory;
-
-#include <kritaimage_export.h>
-
-class KRITAIMAGE_EXPORT KisRecordedActionFactoryRegistry : public KoGenericRegistry<KisRecordedActionFactory*>
-{
-public:
- KisRecordedActionFactoryRegistry();
- ~KisRecordedActionFactoryRegistry() override;
- static KisRecordedActionFactoryRegistry* instance();
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action_load_context.cpp b/libs/image/recorder/kis_recorded_action_load_context.cpp
deleted file mode 100644
index cb1dc1f43dd..00000000000
--- a/libs/image/recorder/kis_recorded_action_load_context.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_load_context.h"
-
-
-KisRecordedActionLoadContext::~KisRecordedActionLoadContext()
-{
-}
diff --git a/libs/image/recorder/kis_recorded_action_load_context.h b/libs/image/recorder/kis_recorded_action_load_context.h
deleted file mode 100644
index 940fc3123b1..00000000000
--- a/libs/image/recorder/kis_recorded_action_load_context.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_LOAD_CONTEXT_H_
-#define _KIS_RECORDED_ACTION_LOAD_CONTEXT_H_
-
-#include "kritaimage_export.h"
-
-class KoAbstractGradient;
-class KoPattern;
-class QString;
-
-class KRITAIMAGE_EXPORT KisRecordedActionLoadContext {
- public:
- virtual ~KisRecordedActionLoadContext();
- virtual KoAbstractGradient* gradient(const QString& name) const = 0;
- virtual KoPattern* pattern(const QString& name) const = 0;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action_save_context.cpp b/libs/image/recorder/kis_recorded_action_save_context.cpp
deleted file mode 100644
index 9230072cc70..00000000000
--- a/libs/image/recorder/kis_recorded_action_save_context.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_save_context.h"
-
-KisRecordedActionSaveContext::~KisRecordedActionSaveContext()
-{
-}
diff --git a/libs/image/recorder/kis_recorded_action_save_context.h b/libs/image/recorder/kis_recorded_action_save_context.h
deleted file mode 100644
index c52ecf5ce37..00000000000
--- a/libs/image/recorder/kis_recorded_action_save_context.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_SAVE_CONTEXT_H_
-#define _KIS_RECORDED_ACTION_SAVE_CONTEXT_H_
-
-#include "kritaimage_export.h"
-
-class KoAbstractGradient;
-class KoPattern;
-
-class KRITAIMAGE_EXPORT KisRecordedActionSaveContext {
- public:
- virtual ~KisRecordedActionSaveContext();
- virtual void saveGradient(const KoAbstractGradient* gradient) = 0;
- virtual void savePattern(const KoPattern* pattern) = 0;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_fill_paint_action.cpp b/libs/image/recorder/kis_recorded_fill_paint_action.cpp
deleted file mode 100644
index 5a26bad2a4f..00000000000
--- a/libs/image/recorder/kis_recorded_fill_paint_action.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_fill_paint_action.h"
-
-#include <QDomElement>
-
-#include <klocalizedstring.h>
-
-#include "kis_image.h"
-#include <kis_fill_painter.h>
-#include "kis_node.h"
-#include "kis_node_query_path.h"
-#include <brushengine/kis_paintop_preset.h>
-#include "kis_play_info.h"
-
-struct Q_DECL_HIDDEN KisRecordedFillPaintAction::Private {
- Private(const KisNodeQueryPath& _projectionPath) : projectionPath(_projectionPath) {}
- QPoint pt;
- KisNodeQueryPath projectionPath;
-};
-
-KisRecordedFillPaintAction::KisRecordedFillPaintAction(
- const KisNodeQueryPath& path,
- const QPoint& pt,
- const KisNodeQueryPath& projectionPath)
- : KisRecordedPaintAction("FillPaintAction", i18n("Fill"), path, 0)
- , d(new Private(projectionPath))
-{
- d->pt = pt;
-}
-
-KisRecordedFillPaintAction::KisRecordedFillPaintAction(const KisRecordedFillPaintAction& rhs) : KisRecordedPaintAction(rhs), d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedFillPaintAction::~KisRecordedFillPaintAction()
-{
- delete d;
-}
-
-void KisRecordedFillPaintAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* context) const
-{
- KisRecordedPaintAction::toXML(doc, elt, context);
- elt.setAttribute("x", d->pt.x());
- elt.setAttribute("y", d->pt.y());
- elt.setAttribute("projectionPath", d->projectionPath.toString());
-}
-
-KisRecordedAction* KisRecordedFillPaintAction::clone() const
-{
- return new KisRecordedFillPaintAction(*this);
-}
-
-KisPainter* KisRecordedFillPaintAction::createPainter(KisPaintDeviceSP device) const
-{
- return new KisFillPainter(device);
-}
-
-void KisRecordedFillPaintAction::playPaint(const KisPlayInfo& info, KisPainter* _painter) const
-{
- QList<KisNodeSP> nodes = d->projectionPath.queryNodes(info.image(), info.currentNode());
- KisPaintDeviceSP projection = 0;
- if (!nodes.isEmpty())
- {
- projection = nodes[0]->projection();
- }
- KisFillPainter* painter = static_cast<KisFillPainter*>(_painter);
- painter->setWidth(info.image()->width());
- painter->setHeight(info.image()->height());
- if (fillStyle() == KisPainter::FillStylePattern)
- {
- painter->fillPattern(d->pt.x(), d->pt.y(), projection);
- } else {
- painter->fillColor(d->pt.x(), d->pt.y(), projection);
- }
-}
-
-KisRecordedFillPaintActionFactory::KisRecordedFillPaintActionFactory() :
- KisRecordedPaintActionFactory("FillPaintAction")
-{
-}
-
-KisRecordedFillPaintActionFactory::~KisRecordedFillPaintActionFactory()
-{
-
-}
-
-KisRecordedAction* KisRecordedFillPaintActionFactory::fromXML(const QDomElement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode = nodeQueryPathFromXML(elt);
- KisNodeQueryPath projectionPathnode = KisNodeQueryPath::fromString(elt.attribute("projectionPath"));
-
- int x = elt.attribute("x", "0").toInt();
- int y = elt.attribute("y", "0").toInt();
-
- KisRecordedFillPaintAction* rplpa = new KisRecordedFillPaintAction(pathnode, QPoint(x,y), projectionPathnode);
-
- setupPaintAction(rplpa, elt, context);
- return rplpa;
-}
diff --git a/libs/image/recorder/kis_recorded_fill_paint_action.h b/libs/image/recorder/kis_recorded_fill_paint_action.h
deleted file mode 100644
index 4a7fd3f00dd..00000000000
--- a/libs/image/recorder/kis_recorded_fill_paint_action.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_FILL_PAINT_ACTION_H_
-#define _KIS_RECORDED_FILL_PAINT_ACTION_H_
-
-#include "recorder/kis_recorded_action.h"
-#include "recorder/kis_recorded_paint_action.h"
-#include "kis_types.h"
-
-#include <kritaimage_export.h>
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedFillPaintAction : public KisRecordedPaintAction
-{
-public:
-
- KisRecordedFillPaintAction(const KisNodeQueryPath& path, const QPoint& pt, const KisNodeQueryPath& projectionPath);
-
- KisRecordedFillPaintAction(const KisRecordedFillPaintAction&);
-
- ~KisRecordedFillPaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- KisPainter* createPainter(KisPaintDeviceSP device) const override;
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const override;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedFillPaintActionFactory : public KisRecordedPaintActionFactory
-{
-public:
- KisRecordedFillPaintActionFactory();
- ~KisRecordedFillPaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_filter_action.cpp b/libs/image/recorder/kis_recorded_filter_action.cpp
deleted file mode 100644
index 5052a43f116..00000000000
--- a/libs/image/recorder/kis_recorded_filter_action.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "recorder/kis_recorded_filter_action.h"
-#include <QDomElement>
-#include <QString>
-
-
-#include "kis_image.h"
-#include "filter/kis_filter.h"
-#include "filter/kis_filter_configuration.h"
-#include "filter/kis_filter_registry.h"
-#include "kis_layer.h"
-#include "kis_node.h"
-#include "kis_selection.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include "kis_selection_mask.h"
-#include "kis_config_widget.h"
-#include "kis_node_query_path.h"
-#include "kis_play_info.h"
-
-struct Q_DECL_HIDDEN KisRecordedFilterAction::Private {
- Private()
- : filterConfiguration(0)
- {
-
- }
-
- const KisFilter* filter;
- QRect rect;
-
- KisFilterConfigurationSP configuration() {
- if (!filterConfiguration) {
- filterConfiguration = filter->defaultConfiguration();
- if (filterConfiguration) {
- filterConfiguration->fromXML(configstr);
- }
- }
- return filterConfiguration;
- }
-
- void setConfiguration(KisFilterConfigurationSP conf) {
- filterConfiguration = conf;
- configstr = conf->toXML();
- }
-
- void setConfig(const QString& cfg) {
- filterConfiguration = 0;
- configstr = cfg;
- }
-
- const QString& config() {
- return configstr;
- }
-
-private:
- QString configstr;
- KisFilterConfigurationSP filterConfiguration;
-};
-
-KisRecordedFilterAction::KisRecordedFilterAction(QString name, const KisNodeQueryPath& path, const KisFilter* filter, const KisFilterConfigurationSP fc) : KisRecordedNodeAction("FilterAction", name, path), d(new Private)
-{
- Q_ASSERT(filter);
- d->filter = filter;
- if (fc) {
- d->setConfig(fc->toXML());
- }
-}
-
-KisRecordedFilterAction::KisRecordedFilterAction(const KisRecordedFilterAction& rhs) : KisRecordedNodeAction(rhs), d(new Private(*rhs.d))
-{
-}
-
-KisRecordedFilterAction::~KisRecordedFilterAction()
-{
- delete d;
-}
-
-void KisRecordedFilterAction::play(KisNodeSP node, const KisPlayInfo& _info, KoUpdater* _updater) const
-{
- KisFilterConfigurationSP kfc = d->configuration();
- KisPaintDeviceSP dev = node->paintDevice();
- KisLayerSP layer = qobject_cast<KisLayer*>(node.data());
- QRect r1 = dev->extent();
- KisTransaction transaction(kundo2_i18n("Filter: \"%1\"", d->filter->name()), dev);
-
- KisImageWSP image = _info.image();
- r1 = r1.intersected(image->bounds());
- if (layer && layer->selection()) {
- r1 = r1.intersected(layer->selection()->selectedExactRect());
- }
-
- d->filter->process(dev, dev, layer->selection(), r1, kfc, _updater);
- node->setDirty(r1);
-
- transaction.commit(_info.undoAdapter());
-}
-
-void KisRecordedFilterAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* context) const
-{
- KisRecordedAction::toXML(doc, elt, context);
- elt.setAttribute("filter", d->filter->id());
- // Save configuration
- KisFilterConfigurationSP kfc = d->configuration();
- if (kfc) {
- QDomElement filterConfigElt = doc.createElement("Params");
- kfc->toXML(doc, filterConfigElt);
- elt.appendChild(filterConfigElt);
- }
-}
-
-KisRecordedAction* KisRecordedFilterAction::clone() const
-{
- return new KisRecordedFilterAction(*this);
-}
-
-const KisFilter* KisRecordedFilterAction::filter() const
-{
- return d->filter;
-}
-
-const KisFilterConfigurationSP KisRecordedFilterAction::filterConfiguration() const
-{
- return d->configuration();
-}
-
-void KisRecordedFilterAction::setFilterConfiguration(KisFilterConfigurationSP config)
-{
- d->setConfiguration(config);
-}
-
-
-KisRecordedFilterActionFactory::KisRecordedFilterActionFactory() :
- KisRecordedActionFactory("FilterAction")
-{
-}
-
-KisRecordedFilterActionFactory::~KisRecordedFilterActionFactory()
-{
-
-}
-
-KisRecordedAction* KisRecordedFilterActionFactory::fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*)
-{
- QString name = elt.attribute("name");
- KisNodeQueryPath pathnode = KisNodeQueryPath::fromString(elt.attribute("path"));
- const KisFilterSP filter = KisFilterRegistry::instance()->get(elt.attribute("filter"));
- if (filter) {
- KisFilterConfigurationSP config = filter->defaultConfiguration();
- QDomElement paramsElt = elt.firstChildElement("Params");
- if (config && !paramsElt.isNull()) {
- config->fromXML(paramsElt);
- }
- KisRecordedFilterAction* rfa = new KisRecordedFilterAction(name, pathnode, filter, config);
- return rfa;
- } else {
- return 0;
- }
-}
diff --git a/libs/image/recorder/kis_recorded_filter_action.h b/libs/image/recorder/kis_recorded_filter_action.h
deleted file mode 100644
index c568117ace5..00000000000
--- a/libs/image/recorder/kis_recorded_filter_action.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_FILTER_ACTION_H_
-#define _KIS_RECORDED_FILTER_ACTION_H_
-
-#include "recorder/kis_recorded_node_action.h"
-
-#include <kritaimage_export.h>
-
-class QString;
-class KisFilterConfiguration;
-
-/**
- * Action representing a filter.
- */
-class KRITAIMAGE_EXPORT KisRecordedFilterAction : public KisRecordedNodeAction
-{
-public:
- /**
- * @param config the filter configuration, the ownership of config remains in the caller.
- */
- KisRecordedFilterAction(QString name, const KisNodeQueryPath& path, const KisFilter* filter, const KisFilterConfigurationSP config);
- KisRecordedFilterAction(const KisRecordedFilterAction&);
- ~KisRecordedFilterAction() override;
- using KisRecordedNodeAction::play;
- void play(KisNodeSP node, const KisPlayInfo& _info, KoUpdater* _updater = 0) const override;
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
- KisRecordedAction* clone() const override;
- const KisFilter* filter() const;
- const KisFilterConfigurationSP filterConfiguration() const;
- /**
- * Set the configuration, and takes the ownership of the config object.
- */
- void setFilterConfiguration(KisFilterConfigurationSP config);
-private:
- struct Private;
- Private* const d;
-};
-
-class KisRecordedFilterActionFactory : public KisRecordedActionFactory
-{
-public:
- KisRecordedFilterActionFactory();
- ~KisRecordedFilterActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_node_action.cc b/libs/image/recorder/kis_recorded_node_action.cc
deleted file mode 100644
index 2529cc519c3..00000000000
--- a/libs/image/recorder/kis_recorded_node_action.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_node_action.h"
-
-#include <QDomDocument>
-#include <KLocalizedString>
-#include <KoUpdater.h>
-
-#include "kis_node_query_path.h"
-#include "kis_play_info.h"
-#include "kis_image.h"
-#include "kis_paint_device.h"
-#include <KoProgressUpdater.h>
-
-struct Q_DECL_HIDDEN KisRecordedNodeAction::Private
-{
- Private(const KisNodeQueryPath& _path) : path(_path) {}
- KisNodeQueryPath path;
-};
-
-KisRecordedNodeAction::KisRecordedNodeAction(const QString& id, const QString& name, const KisNodeQueryPath& path) : KisRecordedAction(id, name), d(new Private(path))
-{
-}
-
-KisRecordedNodeAction::KisRecordedNodeAction(const KisRecordedNodeAction& _rhs) : KisRecordedAction(_rhs), d(new Private(*_rhs.d))
-{
-}
-
-KisRecordedNodeAction::~KisRecordedNodeAction()
-{
- delete d;
-}
-
-void KisRecordedNodeAction::play(const KisPlayInfo& _info, KoUpdater* _updater) const
-{
- QList<KisNodeSP> nodes = nodeQueryPath().queryNodes(_info.image(), _info.currentNode());
- KoProgressUpdater updater(_updater);
- updater.start(nodes.size(), i18n("Applying action to all selected nodes"));
- Q_FOREACH (KisNodeSP node, nodes)
- {
- play(node, _info, updater.startSubtask());
- }
-}
-
-const KisNodeQueryPath& KisRecordedNodeAction::nodeQueryPath() const
-{
- return d->path;
-}
-
-void KisRecordedNodeAction::setNodeQueryPath(const KisNodeQueryPath& nqp)
-{
- d->path = nqp;
-}
-
-void KisRecordedNodeAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const
-{
- Q_UNUSED(doc)
- elt.setAttribute("path", d->path.toString());
-}
diff --git a/libs/image/recorder/kis_recorded_node_action.h b/libs/image/recorder/kis_recorded_node_action.h
deleted file mode 100644
index e9a4884b0de..00000000000
--- a/libs/image/recorder/kis_recorded_node_action.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_NODE_ACTION_H_
-#define _KIS_RECORDED_NODE_ACTION_H_
-
-#include "kis_recorded_action.h"
-class KisNodeQueryPath;
-
-/**
- * Used for action that applys on nodes that are
- */
-class KRITAIMAGE_EXPORT KisRecordedNodeAction : public KisRecordedAction
-{
-public:
- KisRecordedNodeAction(const QString& id, const QString& name, const KisNodeQueryPath& path);
- KisRecordedNodeAction(const KisRecordedNodeAction& _rhs);
- ~KisRecordedNodeAction() override;
- /**
- * Play the action on one node
- */
- virtual void play(KisNodeSP node, const KisPlayInfo&, KoUpdater* _updater) const = 0;
- /**
- * Play the action on all the nodes returned by the nodeQueryPath
- */
- void play(const KisPlayInfo& _info, KoUpdater* _updater) const override;
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
-public:
- const KisNodeQueryPath& nodeQueryPath() const;
- void setNodeQueryPath(const KisNodeQueryPath&);
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_paint_action.cpp b/libs/image/recorder/kis_recorded_paint_action.cpp
deleted file mode 100644
index 5f04f122946..00000000000
--- a/libs/image/recorder/kis_recorded_paint_action.cpp
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Copyright (c) 2007,2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <compositeops/KoVcMultiArchBuildSupport.h> //MSVC requires that Vc come first
-#include "recorder/kis_recorded_paint_action.h"
-
-#include <QDomDocument>
-#include <QDomElement>
-
-#include <KoColor.h>
-#include <KoColorModelStandardIds.h>
-#include <KoCompositeOpRegistry.h>
-#include <KoColorSpace.h>
-
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include <brushengine/kis_paint_information.h>
-#include "kis_paintop_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include <brushengine/kis_paintop_settings.h>
-#include <brushengine/kis_paintop_preset.h>
-#include "kis_paint_device.h"
-#include "kis_image.h"
-#include "kis_layer.h"
-#include "kis_play_info.h"
-#include "kis_node_query_path.h"
-#include <kis_dom_utils.h>
-// Recorder
-#include "kis_recorded_action_factory_registry.h"
-#include "kis_recorded_action_load_context.h"
-#include "kis_recorded_action_save_context.h"
-#include <resources/KoAbstractGradient.h>
-#include <resources/KoPattern.h>
-#include <filter/kis_filter_configuration.h>
-#include <generator/kis_generator_registry.h>
-#include <generator/kis_generator.h>
-
-
-struct Q_DECL_HIDDEN KisRecordedPaintAction::Private {
- KisPaintOpPresetSP paintOpPreset;
- KoColor foregroundColor;
- KoColor backgroundColor;
- qreal opacity; ///< opacity in the range 0.0 -> 100.0
- bool paintIncremental;
- QString compositeOp;
- KisPainter::StrokeStyle strokeStyle;
- KisPainter::FillStyle fillStyle;
- const KoPattern* pattern;
- const KoAbstractGradient* gradient;
- KisFilterConfigurationSP generator;
-};
-
-KisRecordedPaintAction::KisRecordedPaintAction(const QString & id,
- const QString & name,
- const KisNodeQueryPath& path,
- const KisPaintOpPresetSP paintOpPreset)
- : KisRecordedNodeAction(id, name, path)
- , d(new Private)
-{
- if (paintOpPreset)
- {
- d->paintOpPreset = paintOpPreset;
- }
- d->opacity = 1.0;
- d->paintIncremental = true;
- d->compositeOp = COMPOSITE_OVER;
- d->strokeStyle = KisPainter::StrokeStyleBrush;
- d->fillStyle = KisPainter::FillStyleNone;
- d->pattern = 0;
- d->gradient = 0;
-}
-
-KisRecordedPaintAction::KisRecordedPaintAction(const KisRecordedPaintAction& rhs) : KisRecordedNodeAction(rhs), d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedPaintAction::~KisRecordedPaintAction()
-{
- delete d;
-}
-
-void KisRecordedPaintAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* context) const
-{
- KisRecordedAction::toXML(doc, elt, context);
-
- // Paint op presset
- if (d->paintOpPreset)
- {
- QDomElement paintopPressetElt = doc.createElement("PaintopPreset");
- d->paintOpPreset->toXML(doc, paintopPressetElt);
- elt.appendChild(paintopPressetElt);
- }
-
- // ForegroundColor
- QDomElement foregroundColorElt = doc.createElement("ForegroundColor");
- d->foregroundColor.toXML(doc, foregroundColorElt);
- elt.appendChild(foregroundColorElt);
-
- // BackgroundColor
- QDomElement backgroundColorElt = doc.createElement("BackgroundColor");
- d->backgroundColor.toXML(doc, backgroundColorElt);
- elt.appendChild(backgroundColorElt);
-
- // Opacity
- elt.setAttribute("opacity", KisDomUtils::toString(d->opacity));
-
- // paintIncremental
- elt.setAttribute("paintIncremental", d->paintIncremental);
-
- // compositeOp
- elt.setAttribute("compositeOp", d->compositeOp);
-
- // Save stroke style
- switch(d->strokeStyle)
- {
- case KisPainter::StrokeStyleNone:
- elt.setAttribute("strokeStyle", "None");
- break;
- case KisPainter::StrokeStyleBrush:
- elt.setAttribute("strokeStyle", "Brush");
- break;
- }
- // Save fill style
- switch(d->fillStyle)
- {
- case KisPainter::FillStyleNone:
- elt.setAttribute("fillStyle", "None");
- break;
- case KisPainter::FillStyleForegroundColor:
- elt.setAttribute("fillStyle", "PaintColor");
- break;
- case KisPainter::FillStyleBackgroundColor:
- elt.setAttribute("fillStyle", "AlternativeColor");
- break;
- case KisPainter::FillStylePattern:
- elt.setAttribute("fillStyle", "Pattern");
- context->savePattern(d->pattern);
- elt.setAttribute("pattern", d->pattern->name());
- break;
- case KisPainter::FillStyleGradient:
- elt.setAttribute("fillStyle", "Gradient");
- context->saveGradient(d->gradient);
- elt.setAttribute("gradient", d->gradient->name());
- break;
- case KisPainter::FillStyleStrokes:
- elt.setAttribute("fillStyle", "Strokes");
- break;
- case KisPainter::FillStyleGenerator:
- elt.setAttribute("fillStyle", "Generator");
- if (d->generator)
- {
- elt.setAttribute("generator", d->generator->name());
- QDomElement filterConfigElt = doc.createElement("Generator");
- d->generator->toXML(doc, filterConfigElt);
- elt.appendChild(filterConfigElt);
- }
- break;
- }
-}
-
-KisPaintOpPresetSP KisRecordedPaintAction::paintOpPreset() const
-{
- return d->paintOpPreset;
-}
-
-void KisRecordedPaintAction::setPaintOpPreset(KisPaintOpPresetSP preset)
-{
- d->paintOpPreset = preset;
-}
-
-qreal KisRecordedPaintAction::opacity() const
-{
- return d->opacity;
-}
-
-void KisRecordedPaintAction::setOpacity(qreal opacity)
-{
- d->opacity = opacity;
-}
-
-KoColor KisRecordedPaintAction::paintColor() const
-{
- return d->foregroundColor;
-}
-
-void KisRecordedPaintAction::setPaintColor(const KoColor& color)
-{
- d->foregroundColor = color;
-}
-
-KoColor KisRecordedPaintAction::backgroundColor() const
-{
- return d->backgroundColor;
-}
-
-void KisRecordedPaintAction::setBackgroundColor(const KoColor& color)
-{
- d->backgroundColor = color;
-}
-
-QString KisRecordedPaintAction::compositeOp()
-{
- return d->compositeOp;
-}
-
-void KisRecordedPaintAction::setCompositeOp(const QString& id)
-{
- d->compositeOp = id;
-}
-
-void KisRecordedPaintAction::setPaintIncremental(bool v)
-{
- d->paintIncremental = v;
-}
-
-void KisRecordedPaintAction::setStrokeStyle(KisPainter::StrokeStyle strokeStyle)
-{
- d->strokeStyle = strokeStyle;
-}
-
-void KisRecordedPaintAction::setFillStyle(KisPainter::FillStyle fillStyle)
-{
- d->fillStyle = fillStyle;
-}
-
-KisPainter::FillStyle KisRecordedPaintAction::fillStyle() const
-{
- return d->fillStyle;
-}
-
-void KisRecordedPaintAction::setPattern(const KoPattern* pattern)
-{
- d->pattern = pattern;
-}
-
-void KisRecordedPaintAction::setGradient(const KoAbstractGradient* gradient)
-{
- d->gradient = gradient;
-}
-
-void KisRecordedPaintAction::setGenerator(const KisFilterConfigurationSP generator)
-{
- d->generator = generator;
-}
-
-void KisRecordedPaintAction::play(KisNodeSP node, const KisPlayInfo& info, KoUpdater* _updater) const
-{
- dbgUI << "Play recorded paint action on node : " << node->name() ;
- KisTransaction transaction(node->paintDevice());
-
- KisPaintDeviceSP target = 0;
- if (d->paintIncremental) {
- target = node->paintDevice();
- } else {
- target = node->paintDevice()->createCompositionSourceDevice();
- }
-
- KisPainter* painter = createPainter(target);
- painter->setProgress(_updater);
-
- if (d->paintIncremental) {
- painter->setCompositeOp(d->compositeOp);
- painter->setOpacity(d->opacity * 255);
- } else {
- painter->setCompositeOp(node->paintDevice()->colorSpace()->compositeOp(COMPOSITE_ALPHA_DARKEN));
- painter->setOpacity(OPACITY_OPAQUE_U8);
-
- }
-
- painter->setPaintColor(d->foregroundColor);
- painter->setBackgroundColor(d->backgroundColor);
-
- painter->setStrokeStyle(d->strokeStyle);
- painter->setFillStyle(d->fillStyle);
- painter->setPattern(d->pattern);
- painter->setGradient(d->gradient);
- painter->setGenerator(d->generator);
-
- if (d->paintOpPreset) {
- painter->setPaintOpPreset(d->paintOpPreset, node, info.image());
- }
-
- playPaint(info, painter);
-
- if (!d->paintIncremental) {
- KisPainter painter2(node->paintDevice());
- painter2.setCompositeOp(d->compositeOp);
- painter2.setOpacity(d->opacity * 255);
-
- QVector<QRect> dirtyRects = painter->takeDirtyRegion();
- Q_FOREACH (const QRect &rc, dirtyRects) {
- painter2.bitBlt(rc.topLeft(), target, rc);
- }
-
- node->setDirty(painter2.takeDirtyRegion());
- } else {
- node->setDirty(painter->takeDirtyRegion());
- }
- delete painter;
-
- transaction.commit(info.undoAdapter());
-}
-
-KisPainter* KisRecordedPaintAction::createPainter(KisPaintDeviceSP device) const
-{
- return new KisPainter(device);
-}
-
-void KisRecordedPaintActionFactory::setupPaintAction(KisRecordedPaintAction* action, const QDomElement& elt, const KisRecordedActionLoadContext* context)
-{
- QString name = elt.attribute("name");
-
- qreal opacity = opacityFromXML(elt);
- dbgKrita << ppVar(opacity);
- bool paintIncremental = paintIncrementalFromXML(elt);
-
- QString compositeOp = compositeOpFromXML(elt);
- // Decode colors
-
- KoColor bC = backgroundColorFromXML(elt);
- KoColor fC = paintColorFromXML(elt);
-
- action->setName(name);
- action->setBackgroundColor(bC);
- action->setPaintColor(fC);
- action->setOpacity(opacity);
- action->setPaintIncremental(paintIncremental);
- action->setCompositeOp(compositeOp);
-
-
- // Load stroke style
- QString strokeAttr = elt.attribute("strokeStyle", "None");
- if (strokeAttr == "Brush" )
- {
- action->setStrokeStyle(KisPainter::StrokeStyleBrush);
- } else { // "None"
- action->setStrokeStyle(KisPainter::StrokeStyleNone);
- }
- // Save fill style
- QString fillAttr = elt.attribute("fillStyle", "None");
- if (fillAttr == "PaintColor")
- {
- action->setFillStyle(KisPainter::FillStyleForegroundColor);
- } else if(fillAttr == "AlternativeColor")
- {
- action->setFillStyle(KisPainter::FillStyleBackgroundColor);
- } else if(fillAttr == "Pattern")
- {
- const KoPattern* pattern = context->pattern(elt.attribute("pattern"));
- if (pattern)
- {
- action->setFillStyle(KisPainter::FillStylePattern);
- action->setPattern(pattern);
- } else {
- action->setFillStyle(KisPainter::FillStyleNone);
- }
- } else if(fillAttr == "Gradient")
- {
- const KoAbstractGradient* gradient = context->gradient(elt.attribute("gradient"));
- if (gradient)
- {
- action->setFillStyle(KisPainter::FillStyleGradient);
- action->setGradient(gradient);
- } else {
- action->setFillStyle(KisPainter::FillStyleNone);
- }
- } else if(fillAttr == "Strokes")
- {
- action->setFillStyle(KisPainter::FillStyleStrokes);
- } else if(fillAttr == "Generator")
- {
- KisGeneratorSP g = KisGeneratorRegistry::instance()->value(elt.attribute("generator"));
- KisFilterConfigurationSP config = 0;
- if (g)
- {
- config = g->defaultConfiguration();
- QDomElement paramsElt = elt.firstChildElement("Generator");
- if (config && !paramsElt.isNull()) {
- config->fromXML(paramsElt);
- }
- }
- if(config)
- {
- action->setFillStyle(KisPainter::FillStyleGenerator);
- action->setGenerator(config);
- } else {
- action->setFillStyle(KisPainter::FillStyleNone);
- }
- }
-}
-
-KisPaintOpPresetSP KisRecordedPaintActionFactory::paintOpPresetFromXML(const QDomElement& elt)
-{
-
- QDomElement settingsElt = elt.firstChildElement("PaintopPreset");
- if (!settingsElt.isNull()) {
- KisPaintOpPresetSP settings = new KisPaintOpPreset;
- settings->fromXML(settingsElt);
- return settings;
- } else {
- errImage << "No <PaintopPreset /> found";
- return 0;
- }
-}
-
-KoColor KisRecordedPaintActionFactory::paintColorFromXML(const QDomElement& elt)
-{
- return colorFromXML(elt, "ForegroundColor");
-}
-
-KoColor KisRecordedPaintActionFactory::backgroundColorFromXML(const QDomElement& elt)
-{
- return colorFromXML(elt, "BackgroundColor");
-}
-
-KoColor KisRecordedPaintActionFactory::colorFromXML(const QDomElement& elt, const QString& elementName)
-{
- QDomElement colorElt = elt.firstChildElement(elementName);
- KoColor bC;
-
- if (!colorElt.isNull()) {
- bC = KoColor::fromXML(colorElt.firstChildElement(), Integer8BitsColorDepthID.id());
- bC.setOpacity(quint8(255));
- dbgImage << elementName << " color : " << bC.toQColor();
- } else {
- dbgImage << "Warning: no <" << elementName << " /> found";
- }
- return bC;
-}
-
-qreal KisRecordedPaintActionFactory::opacityFromXML(const QDomElement& elt)
-{
- return KisDomUtils::toDouble(elt.attribute("opacity", "1.0"));
-}
-
-bool KisRecordedPaintActionFactory::paintIncrementalFromXML(const QDomElement& elt)
-{
- return KisDomUtils::toInt(elt.attribute("paintIncremental", "1"));
-}
-
-QString KisRecordedPaintActionFactory::compositeOpFromXML(const QDomElement& elt)
-{
- return elt.attribute("compositeOp", COMPOSITE_OVER);
-}
-
-KisNodeQueryPath KisRecordedPaintActionFactory::nodeQueryPathFromXML(const QDomElement& elt)
-{
- return KisNodeQueryPath::fromString(elt.attribute("path"));
-}
diff --git a/libs/image/recorder/kis_recorded_paint_action.h b/libs/image/recorder/kis_recorded_paint_action.h
deleted file mode 100644
index 68b33119bb6..00000000000
--- a/libs/image/recorder/kis_recorded_paint_action.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2007,2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_PAINT_ACTION_H_
-#define _KIS_RECORDED_PAINT_ACTION_H_
-
-#include "recorder/kis_recorded_node_action.h"
-#include "kis_types.h"
-#include "kis_painter.h"
-
-class KisPainter;
-class KoColor;
-
-#include <kritaimage_export.h>
-
-/**
- * Base class for paint action.
- */
-class KRITAIMAGE_EXPORT KisRecordedPaintAction : public KisRecordedNodeAction
-{
-public:
-
- KisRecordedPaintAction(const QString & id,
- const QString & name,
- const KisNodeQueryPath& path,
- KisPaintOpPresetSP paintOpPreset);
-
- KisRecordedPaintAction(const KisRecordedPaintAction&);
-
- ~KisRecordedPaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
-
- using KisRecordedNodeAction::play;
- void play(KisNodeSP node, const KisPlayInfo& info, KoUpdater* _updater = 0) const override;
-
-protected:
- /**
- * This function will create a painter for the given device. The default
- * implementation creates a KisPainter, subclass can reimplement it if
- * they want to use one of the subclass of KisPainter.
- */
- virtual KisPainter* createPainter(KisPaintDeviceSP device) const;
- /**
- * Reimplement this function in a subclass to play the painting.
- */
- virtual void playPaint(const KisPlayInfo&, KisPainter* painter) const = 0;
-
-public:
- KisPaintOpPresetSP paintOpPreset() const;
- void setPaintOpPreset(KisPaintOpPresetSP preset);
- /**
- * @return the opacity in the range 0.0->1.0
- */
- qreal opacity() const;
- void setOpacity(qreal );
- KoColor paintColor() const;
- void setPaintColor(const KoColor& color);
- KoColor backgroundColor() const;
- void setBackgroundColor(const KoColor& color);
- QString compositeOp();
- void setCompositeOp(const QString& );
- void setPaintIncremental(bool );
- void setStrokeStyle(KisPainter::StrokeStyle );
- void setFillStyle(KisPainter::FillStyle );
- KisPainter::FillStyle fillStyle() const;
- void setPattern(const KoPattern* );
- void setGradient(const KoAbstractGradient* gradient);
- void setGenerator(const KisFilterConfigurationSP generator);
-private:
-
- struct Private;
- Private* const d;
-};
-
-class KisRecordedPaintActionFactory : public KisRecordedActionFactory
-{
-public:
- KisRecordedPaintActionFactory(const QString & id) : KisRecordedActionFactory(id) {}
- ~KisRecordedPaintActionFactory() override {}
-protected:
-
- void setupPaintAction(KisRecordedPaintAction* action, const QDomElement& elt, const KisRecordedActionLoadContext*);
- KisPaintOpPresetSP paintOpPresetFromXML(const QDomElement& elt);
- KoColor paintColorFromXML(const QDomElement& elt);
- KoColor backgroundColorFromXML(const QDomElement& elt);
- KoColor colorFromXML(const QDomElement& elt, const QString& elementName);
- qreal opacityFromXML(const QDomElement& elt);
- bool paintIncrementalFromXML(const QDomElement& elt);
- QString compositeOpFromXML(const QDomElement& elt);
- KisNodeQueryPath nodeQueryPathFromXML(const QDomElement& elt);
-};
-
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_path_paint_action.cpp b/libs/image/recorder/kis_recorded_path_paint_action.cpp
deleted file mode 100644
index a4951a5194b..00000000000
--- a/libs/image/recorder/kis_recorded_path_paint_action.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <compositeops/KoVcMultiArchBuildSupport.h> //MSVC requires that Vc come first
-#include "recorder/kis_recorded_path_paint_action.h"
-#include <QDomDocument>
-#include <QDomElement>
-
-#include <KoColor.h>
-#include <KoColorModelStandardIds.h>
-#include <KoCompositeOp.h>
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include <brushengine/kis_paint_information.h>
-#include "kis_paintop_registry.h"
-#include "recorder/kis_recorded_action_factory_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include <brushengine/kis_paintop_settings.h>
-#include <brushengine/kis_paintop_preset.h>
-#include "kis_paint_device.h"
-#include "kis_image.h"
-#include "kis_layer.h"
-#include "kis_node_query_path.h"
-#include <kis_dom_utils.h>
-
-struct Q_DECL_HIDDEN KisRecordedPathPaintAction::Private {
- struct BezierCurveSlice {
- enum Type {
- Point,
- Line,
- Curve
- };
- Type type;
- KisPaintInformation point1;
- QPointF control1;
- QPointF control2;
- KisPaintInformation point2;
- };
-
- Private(const KisDistanceInitInfo &startDistInfo) :
- startDistInfo(startDistInfo) {}
-
- QList<BezierCurveSlice> curveSlices;
-
- // Information about distance and spacing at the start of the action.
- KisDistanceInitInfo startDistInfo;
-};
-
-KisRecordedPathPaintAction::KisRecordedPathPaintAction(
- const KisNodeQueryPath& path,
- const KisPaintOpPresetSP preset,
- const KisDistanceInitInfo& startDistInfo)
- : KisRecordedPaintAction("PathPaintAction", i18n("Path"), path, preset)
- , d(new Private(startDistInfo))
-{
-}
-
-KisRecordedPathPaintAction::KisRecordedPathPaintAction(const KisRecordedPathPaintAction& rhs) : KisRecordedPaintAction(rhs), d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedPathPaintAction::~KisRecordedPathPaintAction()
-{
- delete d;
-}
-
-KisDistanceInitInfo KisRecordedPathPaintAction::getInitDistInfo() const
-{
- return d->startDistInfo;
-}
-
-void KisRecordedPathPaintAction::setInitDistInfo(const KisDistanceInitInfo &startDistInfo)
-{
- d->startDistInfo = startDistInfo;
-}
-
-void KisRecordedPathPaintAction::addPoint(const KisPaintInformation& info)
-{
- Private::BezierCurveSlice slice;
- slice.type = Private::BezierCurveSlice::Point;
- slice.point1 = info;
- d->curveSlices.append(slice);
-}
-
-void KisRecordedPathPaintAction::addLine(const KisPaintInformation& point1, const KisPaintInformation& point2)
-{
- Private::BezierCurveSlice slice;
- slice.type = Private::BezierCurveSlice::Line;
- slice.point1 = point1;
- slice.point2 = point2;
- d->curveSlices.append(slice);
-}
-
-void KisRecordedPathPaintAction::addPolyLine(const QList<QPointF>& points)
-{
- QPointF previousPoint = points[0];
- for(int i = 1; i < points.size(); ++i) {
- QPointF pt = points[i];
- addLine(KisPaintInformation(previousPoint), KisPaintInformation(pt));
- previousPoint = pt;
- }
-}
-
-
-void KisRecordedPathPaintAction::addCurve(const KisPaintInformation& point1,
- const QPointF& control1,
- const QPointF& control2,
- const KisPaintInformation& point2)
-{
- Private::BezierCurveSlice slice;
- slice.type = Private::BezierCurveSlice::Curve;
- slice.point1 = point1;
- slice.control1 = control1;
- slice.control2 = control2;
- slice.point2 = point2;
- d->curveSlices.append(slice);
-}
-
-void KisRecordedPathPaintAction::playPaint(const KisPlayInfo&, KisPainter* painter) const
-{
- dbgImage << "play path paint action with " << d->curveSlices.size() << " slices";
- if (d->curveSlices.size() <= 0) return;
-
- KisDistanceInformation savedDist = d->startDistInfo.makeDistInfo();
-
- Q_FOREACH (const Private::BezierCurveSlice &slice, d->curveSlices)
- {
- switch(slice.type)
- {
- case Private::BezierCurveSlice::Point:
- painter->paintAt(slice.point1, &savedDist);
- break;
- case Private::BezierCurveSlice::Line:
- painter->paintLine(slice.point1, slice.point2, &savedDist);
- break;
- case Private::BezierCurveSlice::Curve:
- painter->paintBezierCurve(slice.point1, slice.control1, slice.control2, slice.point2, &savedDist);
- break;
- }
- }
-}
-
-void KisRecordedPathPaintAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* context) const
-{
- KisRecordedPaintAction::toXML(doc, elt, context);
- QDomElement waypointsElt = doc.createElement("Slices");
- Q_FOREACH (const Private::BezierCurveSlice & slice, d->curveSlices) {
- switch(slice.type)
- {
- case Private::BezierCurveSlice::Point:
- {
- QDomElement infoElt = doc.createElement("Point");
- slice.point1.toXML(doc, infoElt);
-
- waypointsElt.appendChild(infoElt);
- break;
- }
- case Private::BezierCurveSlice::Line:
- {
- QDomElement infoElt = doc.createElement("Line");
- // Point1
- QDomElement point1Elt = doc.createElement("Point1");
- slice.point1.toXML(doc, point1Elt);
- infoElt.appendChild(point1Elt);
- // Point2
- QDomElement point2Elt = doc.createElement("Point2");
- slice.point2.toXML(doc, point2Elt);
- infoElt.appendChild(point2Elt);
-
- waypointsElt.appendChild(infoElt);
- break;
- }
- case Private::BezierCurveSlice::Curve:
- {
- QDomElement infoElt = doc.createElement("Curve");
- // Point1
- QDomElement point1Elt = doc.createElement("Point1");
- slice.point1.toXML(doc, point1Elt);
- infoElt.appendChild(point1Elt);
- // Control1
- QDomElement control1Elt = doc.createElement("Control1");
- control1Elt.setAttribute("x", KisDomUtils::toString(slice.control1.x()));
- control1Elt.setAttribute("y", KisDomUtils::toString(slice.control1.y()));
- infoElt.appendChild(control1Elt);
- // Control2
- QDomElement control2Elt = doc.createElement("Control2");
- control2Elt.setAttribute("x", KisDomUtils::toString(slice.control2.x()));
- control2Elt.setAttribute("y", KisDomUtils::toString(slice.control2.y()));
- infoElt.appendChild(control2Elt);
- // Point2
- QDomElement point2Elt = doc.createElement("Point2");
- slice.point2.toXML(doc, point2Elt);
- infoElt.appendChild(point2Elt);
-
- waypointsElt.appendChild(infoElt);
- }
- }
- }
- elt.appendChild(waypointsElt);
-
- QDomElement initDistElt = doc.createElement("StartDistInfo");
- d->startDistInfo.toXML(doc, initDistElt);
- elt.appendChild(initDistElt);
-}
-
-KisRecordedAction* KisRecordedPathPaintAction::clone() const
-{
- return new KisRecordedPathPaintAction(*this);
-}
-
-
-KisRecordedPathPaintActionFactory::KisRecordedPathPaintActionFactory() :
- KisRecordedPaintActionFactory("PathPaintAction")
-{
-}
-
-KisRecordedPathPaintActionFactory::~KisRecordedPathPaintActionFactory()
-{
-
-}
-
-KisRecordedAction* KisRecordedPathPaintActionFactory::fromXML(const QDomElement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode = nodeQueryPathFromXML(elt);
-
- // Decode pressets
- KisPaintOpPresetSP paintOpPreset = paintOpPresetFromXML(elt);
-
- KisRecordedPathPaintAction* rplpa = new KisRecordedPathPaintAction(pathnode, paintOpPreset,
- KisDistanceInitInfo());
-
- setupPaintAction(rplpa, elt, context);
-
- QDomElement wpElt = elt.firstChildElement("Slices");
- if (!wpElt.isNull()) {
- QDomNode nWp = wpElt.firstChild();
- while (!nWp.isNull()) {
- QDomElement eWp = nWp.toElement();
- if (!eWp.isNull()) {
- if( eWp.tagName() == "Point") {
- rplpa->addPoint(KisPaintInformation::fromXML(eWp));
- } else if(eWp.tagName() == "Line") {
- rplpa->addLine(KisPaintInformation::fromXML(eWp.firstChildElement("Point1")),
- KisPaintInformation::fromXML(eWp.firstChildElement("Point2")));
- } else if( eWp.tagName() == "Curve") {
- QDomElement control1Elt = eWp.firstChildElement("Control1");
- QDomElement control2Elt = eWp.firstChildElement("Control2");
- rplpa->addCurve(KisPaintInformation::fromXML(eWp.firstChildElement("Point1")),
- QPointF(KisDomUtils::toDouble(control1Elt.attribute("x", "0.0")),
- KisDomUtils::toDouble(control1Elt.attribute("y", "0.0"))),
- QPointF(KisDomUtils::toDouble(control2Elt.attribute("x", "0.0")),
- KisDomUtils::toDouble(control2Elt.attribute("y", "0.0"))),
- KisPaintInformation::fromXML(eWp.firstChildElement("Point2")));
- } else {
- dbgImage << "Unsupported <" << eWp.tagName() << " /> element";
- }
- }
- nWp = nWp.nextSibling();
- }
- } else {
- dbgImage << "Warning: no <Waypoints /> found";
- }
-
- QDomElement initDistInfoElt = elt.firstChildElement("StartDistInfo");
- if (!initDistInfoElt.isNull()) {
- rplpa->setInitDistInfo(KisDistanceInitInfo::fromXML(initDistInfoElt));
- } else {
- dbgImage << "Warning: no <StartDistInfo /> found";
- }
-
- return rplpa;
-}
-
-
diff --git a/libs/image/recorder/kis_recorded_path_paint_action.h b/libs/image/recorder/kis_recorded_path_paint_action.h
deleted file mode 100644
index 607eb47ccca..00000000000
--- a/libs/image/recorder/kis_recorded_path_paint_action.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_PATH_PAINT_ACTIONS_H_
-#define _KIS_RECORDED_PATH_PAINT_ACTIONS_H_
-
-#include "recorder/kis_recorded_action.h"
-#include "recorder/kis_recorded_paint_action.h"
-#include "kis_types.h"
-
-class KisPaintInformation;
-class KisPainter;
-class KisDistanceInitInfo;
-
-#include <kritaimage_export.h>
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedPathPaintAction : public KisRecordedPaintAction
-{
-
-public:
-
- /**
- * @param startDist - Provides initial information related to distance and spacing, which can
- * have an effect on how the path is painted.
- */
- KisRecordedPathPaintAction(const KisNodeQueryPath& path,
- const KisPaintOpPresetSP paintOpPreset,
- const KisDistanceInitInfo& startDistInfo);
-
- KisRecordedPathPaintAction(const KisRecordedPathPaintAction&);
-
- ~KisRecordedPathPaintAction() override;
-
- KisDistanceInitInfo getInitDistInfo() const;
-
- void setInitDistInfo(const KisDistanceInitInfo &startDistInfo);
-
- void addPoint(const KisPaintInformation& info);
- void addLine(const KisPaintInformation& point1, const KisPaintInformation& point2);
- void addPolyLine(const QList<QPointF>& points);
- void addCurve(const KisPaintInformation& point1,
- const QPointF& control1,
- const QPointF& control2,
- const KisPaintInformation& point2);
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const override;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedPathPaintActionFactory : public KisRecordedPaintActionFactory
-{
-public:
- KisRecordedPathPaintActionFactory();
- ~KisRecordedPathPaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_shape_paint_action.cpp b/libs/image/recorder/kis_recorded_shape_paint_action.cpp
deleted file mode 100644
index ea48b426d88..00000000000
--- a/libs/image/recorder/kis_recorded_shape_paint_action.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <compositeops/KoVcMultiArchBuildSupport.h> //MSVC requires that Vc come first
-
-#include "recorder/kis_recorded_shape_paint_action.h"
-
-#include <QDomDocument>
-#include <QDomElement>
-
-#include <KoColor.h>
-#include <KoColorModelStandardIds.h>
-#include <KoCompositeOp.h>
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include <brushengine/kis_paint_information.h>
-#include "kis_paintop_registry.h"
-#include "recorder/kis_recorded_action_factory_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include <brushengine/kis_paintop_settings.h>
-#include <brushengine/kis_paintop_preset.h>
-#include "kis_paint_device.h"
-#include "kis_image.h"
-#include "kis_layer.h"
-#include "kis_node_query_path.h"
-#include <kis_dom_utils.h>
-
-struct Q_DECL_HIDDEN KisRecordedShapePaintAction::Private {
- Shape shape;
- QRectF rectangle;
-};
-
-QString selectName(KisRecordedShapePaintAction::Shape s)
-{
- switch(s)
- {
- case KisRecordedShapePaintAction::Ellipse:
- return i18n("Ellipse");
- case KisRecordedShapePaintAction::Rectangle:
- return i18n("Rectangle");
- }
- return QString();
-}
-
-KisRecordedShapePaintAction::KisRecordedShapePaintAction(
- const KisNodeQueryPath& path,
- const KisPaintOpPresetSP preset,
- Shape shape,
- const QRectF& rect)
- : KisRecordedPaintAction("ShapePaintAction", selectName(shape), path, preset)
- , d(new Private)
-{
- d->shape = shape;
- d->rectangle = rect;
-}
-
-KisRecordedShapePaintAction::KisRecordedShapePaintAction(const KisRecordedShapePaintAction& rhs) : KisRecordedPaintAction(rhs), d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedShapePaintAction::~KisRecordedShapePaintAction()
-{
- delete d;
-}
-
-void KisRecordedShapePaintAction::playPaint(const KisPlayInfo&, KisPainter* painter) const
-{
- switch(d->shape)
- {
- case Ellipse:
- painter->paintEllipse(d->rectangle);
- break;
- case Rectangle:
- painter->paintRect(d->rectangle);
- break;
- }
-}
-
-void KisRecordedShapePaintAction::toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* context) const
-{
- KisRecordedPaintAction::toXML(doc, elt, context);
- QDomElement rectangleElt = doc.createElement("Rectangle");
- rectangleElt.setAttribute("x", KisDomUtils::toString(d->rectangle.x()));
- rectangleElt.setAttribute("y", KisDomUtils::toString(d->rectangle.y()));
- rectangleElt.setAttribute("width", KisDomUtils::toString(d->rectangle.width()));
- rectangleElt.setAttribute("height", KisDomUtils::toString(d->rectangle.height()));
- elt.appendChild(rectangleElt);
- switch(d->shape)
- {
- case Ellipse:
- elt.setAttribute("shape", "Ellipse");
- break;
- case Rectangle:
- elt.setAttribute("shape", "Rectangle");
- break;
- }
-}
-
-KisRecordedAction* KisRecordedShapePaintAction::clone() const
-{
- return new KisRecordedShapePaintAction(*this);
-}
-
-
-KisRecordedShapePaintActionFactory::KisRecordedShapePaintActionFactory() :
- KisRecordedPaintActionFactory("ShapePaintAction")
-{
-}
-
-KisRecordedShapePaintActionFactory::~KisRecordedShapePaintActionFactory()
-{
-
-}
-
-KisRecordedAction* KisRecordedShapePaintActionFactory::fromXML(const QDomElement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode = nodeQueryPathFromXML(elt);
-
- // Decode pressets
- KisPaintOpPresetSP paintOpPreset = paintOpPresetFromXML(elt);
-
- QDomElement ellipseElt = elt.firstChildElement("Rectangle");
- qreal x, y, width, height;
- if (!ellipseElt.isNull()) {
- x = KisDomUtils::toDouble(ellipseElt.attribute("x", "0.0"));
- y = KisDomUtils::toDouble(ellipseElt.attribute("y", "0.0"));
- width = KisDomUtils::toDouble(ellipseElt.attribute("width", "0.0"));
- height = KisDomUtils::toDouble(ellipseElt.attribute("height", "0.0"));
- }
- else {
- x = 0;
- y = 0;
- width = 0;
- height = 0;
- dbgImage << "Warning: no <Rectangle /> found";
- }
-
- KisRecordedShapePaintAction::Shape shape = KisRecordedShapePaintAction::Ellipse;
- QString shapeStr = elt.attribute("shape", "Ellipse");
- if (shapeStr == "Ellipse")
- {
- shape = KisRecordedShapePaintAction::Ellipse;
- } else { // shapeStr == "Rectangle"
- shape = KisRecordedShapePaintAction::Rectangle;
- }
-
- KisRecordedShapePaintAction* rplpa = new KisRecordedShapePaintAction(pathnode, paintOpPreset, shape, QRectF(x, y, width, height));
-
- setupPaintAction(rplpa, elt, context);
- return rplpa;
-}
diff --git a/libs/image/recorder/kis_recorded_shape_paint_action.h b/libs/image/recorder/kis_recorded_shape_paint_action.h
deleted file mode 100644
index cc190ed8d02..00000000000
--- a/libs/image/recorder/kis_recorded_shape_paint_action.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ELLIPSE_PAINT_ACTION_H_
-#define _KIS_RECORDED_ELLIPSE_PAINT_ACTION_H_
-
-#include "recorder/kis_recorded_action.h"
-#include "recorder/kis_recorded_paint_action.h"
-#include "kis_types.h"
-
-#include <kritaimage_export.h>
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedShapePaintAction : public KisRecordedPaintAction
-{
-public:
- enum Shape {
- Ellipse,
- Rectangle
- };
-public:
-
- KisRecordedShapePaintAction(const KisNodeQueryPath& path,
- const KisPaintOpPresetSP paintOpPreset,
- Shape shape,
- const QRectF& rect);
-
- KisRecordedShapePaintAction(const KisRecordedShapePaintAction&);
-
- ~KisRecordedShapePaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveContext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const override;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedShapePaintActionFactory : public KisRecordedPaintActionFactory
-{
-public:
- KisRecordedShapePaintActionFactory();
- ~KisRecordedShapePaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedActionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/tests/CMakeLists.txt b/libs/image/tests/CMakeLists.txt
index 979f93f1dd4..aff2df122c9 100644
--- a/libs/image/tests/CMakeLists.txt
+++ b/libs/image/tests/CMakeLists.txt
@@ -85,7 +85,6 @@ ecm_add_tests(
kis_simple_stroke_strategy_test.cpp
kis_stroke_strategy_undo_command_based_test.cpp
kis_strokes_queue_test.cpp
- kis_macro_test.cpp
kis_mask_test.cpp
kis_math_toolbox_test.cpp
kis_name_server_test.cpp
@@ -96,9 +95,6 @@ ecm_add_tests(
kis_distance_information_test.cpp
kis_paintop_test.cpp
kis_pattern_test.cpp
- kis_recorded_action_factory_registry_test.cpp
- kis_recorded_action_test.cpp
- kis_recorded_filter_action_test.cpp
kis_selection_mask_test.cpp
kis_shared_ptr_test.cpp
kis_bsplines_test.cpp
@@ -110,8 +106,8 @@ ecm_add_tests(
kis_filter_config_widget_test.cpp
kis_mask_generator_test.cpp
kis_cubic_curve_test.cpp
- kis_node_query_path_test.cpp
kis_fixed_point_maths_test.cpp
+ kis_node_query_path_test.cpp
kis_filter_weights_buffer_test.cpp
kis_filter_weights_applicator_test.cpp
kis_fill_interval_test.cpp
diff --git a/libs/image/tests/kis_macro_test.cpp b/libs/image/tests/kis_macro_test.cpp
deleted file mode 100644
index b921304a096..00000000000
--- a/libs/image/tests/kis_macro_test.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_macro_test.h"
-
-#include <QTest>
-#include "recorder/kis_macro.h"
-#include <KoColorSpace.h>
-#include <KoColorSpaceRegistry.h>
-#include "kis_image.h"
-
-#include "recorder/kis_recorded_action.h"
-#include <recorder/kis_node_query_path.h>
-
-class TestAction : public KisRecordedAction
-{
-public:
-
- TestAction(const QString & id, const QString & name)
- : KisRecordedAction(id, name) {
- }
-
- void play(const KisPlayInfo&, KoUpdater*) const override {
- }
-
- KisRecordedAction* clone() const override {
- return new TestAction(id(), name());
- }
-
-};
-
-
-void KisMacroTest::testCreation()
-{
- QList<KisRecordedAction*> actions;
- TestAction tc("bla", "bla");
- actions << &tc;
-
- const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
- KisImageSP image = new KisImage(0, 512, 512, cs, "test");
-
- KisMacro a;
- KisMacro b(actions);
-}
-
-
-QTEST_MAIN(KisMacroTest)
diff --git a/libs/image/tests/kis_macro_test.h b/libs/image/tests/kis_macro_test.h
deleted file mode 100644
index 8c8099195d1..00000000000
--- a/libs/image/tests/kis_macro_test.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef KIS_MACRO_TEST_H
-#define KIS_MACRO_TEST_H
-
-#include <QtTest>
-
-class KisMacroTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
-
- void testCreation();
-
-};
-
-#endif
diff --git a/libs/image/tests/kis_node_query_path_test.cpp b/libs/image/tests/kis_node_query_path_test.cpp
index 6a77305b283..a694526048f 100644
--- a/libs/image/tests/kis_node_query_path_test.cpp
+++ b/libs/image/tests/kis_node_query_path_test.cpp
@@ -20,7 +20,7 @@
#include <QTest>
-#include "recorder/kis_node_query_path.h"
+#include "kis_node_query_path.h"
#include <kis_node.h>
#include <kis_image.h>
#include <kis_group_layer.h>
diff --git a/libs/image/tests/kis_recorded_action_factory_registry_test.cpp b/libs/image/tests/kis_recorded_action_factory_registry_test.cpp
deleted file mode 100644
index b6192ef6e28..00000000000
--- a/libs/image/tests/kis_recorded_action_factory_registry_test.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_factory_registry_test.h"
-
-#include <QTest>
-#include "recorder/kis_recorded_action_factory_registry.h"
-
-void KisRecordedActionFactoryRegistryTest::testCreation()
-{
- KisRecordedActionFactoryRegistry test;
-}
-
-
-QTEST_MAIN(KisRecordedActionFactoryRegistryTest)
diff --git a/libs/image/tests/kis_recorded_action_factory_registry_test.h b/libs/image/tests/kis_recorded_action_factory_registry_test.h
deleted file mode 100644
index 1f76a932127..00000000000
--- a/libs/image/tests/kis_recorded_action_factory_registry_test.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef KIS_RECORDED_ACTION_FACTORY_REGISTRY_TEST_H
-#define KIS_RECORDED_ACTION_FACTORY_REGISTRY_TEST_H
-
-#include <QtTest>
-
-class KisRecordedActionFactoryRegistryTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
-
- void testCreation();
-
-};
-
-#endif
diff --git a/libs/image/tests/kis_recorded_action_test.cpp b/libs/image/tests/kis_recorded_action_test.cpp
deleted file mode 100644
index 5481427f562..00000000000
--- a/libs/image/tests/kis_recorded_action_test.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_test.h"
-
-#include <QTest>
-#include <kis_node.h>
-#include "recorder/kis_recorded_action.h"
-#include <recorder/kis_node_query_path.h>
-
-class TestAction : public KisRecordedAction
-{
-public:
-
- TestAction(const QString & id, const QString & name)
- : KisRecordedAction(id, name) {
- }
-
- void play(const KisPlayInfo&, KoUpdater*) const override {
- }
-
- KisRecordedAction* clone() const override {
- return new TestAction(id(), name());
- }
-
-};
-
-
-void KisRecordedActionTest::testCreation()
-{
- TestAction tc("bla", "bla");
-}
-
-
-QTEST_MAIN(KisRecordedActionTest)
diff --git a/libs/image/tests/kis_recorded_action_test.h b/libs/image/tests/kis_recorded_action_test.h
deleted file mode 100644
index cc20fa40f47..00000000000
--- a/libs/image/tests/kis_recorded_action_test.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef KIS_RECORDED_ACTION_TEST_H
-#define KIS_RECORDED_ACTION_TEST_H
-
-#include <QtTest>
-
-class KisRecordedActionTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
-
- void testCreation();
-
-};
-
-#endif
diff --git a/libs/image/tests/kis_recorded_filter_action_test.cpp b/libs/image/tests/kis_recorded_filter_action_test.cpp
deleted file mode 100644
index 94677fcb8b7..00000000000
--- a/libs/image/tests/kis_recorded_filter_action_test.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_filter_action_test.h"
-
-#include <QTest>
-#include "recorder/kis_recorded_filter_action.h"
-#include <KoColorSpace.h>
-#include <KoColorSpaceRegistry.h>
-#include "kis_paint_layer.h"
-#include "filter/kis_filter.h"
-#include "filter/kis_filter_configuration.h"
-#include "filter/kis_filter_registry.h"
-#include "kis_image.h"
-#include "kis_paint_device.h"
-#include <recorder/kis_node_query_path.h>
-
-void KisRecordedFilterActionTest::testCreation()
-{
- const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
- KisFilterSP f = KisFilterRegistry::instance()->value("invert");
- KisFilterConfigurationSP kfc = f->defaultConfiguration();
- KisImageSP image = new KisImage(0, 10, 10, cs, "merge test");
- KisPaintLayerSP layer = new KisPaintLayer(image, "test", OPACITY_OPAQUE_U8);
-
- KisRecordedFilterAction test("invert", KisNodeQueryPath::absolutePath(layer), f, kfc);
-}
-
-
-QTEST_MAIN(KisRecordedFilterActionTest)
diff --git a/libs/image/tests/kis_recorded_filter_action_test.h b/libs/image/tests/kis_recorded_filter_action_test.h
deleted file mode 100644
index f517964e674..00000000000
--- a/libs/image/tests/kis_recorded_filter_action_test.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2007 Boudewijn Rempt boud at valdyas.org
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef KIS_RECORDED_FILTER_ACTION_TEST_H
-#define KIS_RECORDED_FILTER_ACTION_TEST_H
-
-#include <QtTest>
-
-class KisRecordedFilterActionTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
-
- void testCreation();
-
-};
-
-#endif
diff --git a/libs/koplugin/KisMimeDatabase.cpp b/libs/koplugin/KisMimeDatabase.cpp
index 6fcf7f874fc..10fb99289c6 100644
--- a/libs/koplugin/KisMimeDatabase.cpp
+++ b/libs/koplugin/KisMimeDatabase.cpp
@@ -227,11 +227,6 @@ void KisMimeDatabase::fillMimeData()
mimeType.suffixes = QStringList() << "ocio";
s_mimeDatabase << mimeType;
- mimeType.mimeType = "application/x-krita-recorded-macro";
- mimeType.description = i18nc("description of a file type", "Krita Recorded Action");
- mimeType.suffixes = QStringList() << "krarec";
- s_mimeDatabase << mimeType;
-
mimeType.mimeType = "application/x-gimp-gradient";
mimeType.description = i18nc("description of a file type", "GIMP Gradients");
mimeType.suffixes = QStringList() << "ggr";
diff --git a/libs/pigment/KoColorSpaceRegistry.h b/libs/pigment/KoColorSpaceRegistry.h
index 89abd8c935e..8db1fe20540 100644
--- a/libs/pigment/KoColorSpaceRegistry.h
+++ b/libs/pigment/KoColorSpaceRegistry.h
@@ -330,7 +330,6 @@ private:
friend class KisCrashFilterTest;
friend class KoColorSpacesBenchmark;
friend class TestKoColorSpaceSanity;
- friend class KisActionRecorderTest;
friend class TestColorConversionSystem;
friend class FriendOfColorSpaceRegistry;
diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt
index 38b6e288e80..fe7af228024 100644
--- a/libs/ui/CMakeLists.txt
+++ b/libs/ui/CMakeLists.txt
@@ -165,15 +165,6 @@ set(kritaui_LIB_SRCS
opengl/kis_texture_tile_info_pool.cpp
opengl/KisOpenGLUpdateInfoBuilder.cpp
kis_fps_decoration.cpp
- recorder/kis_node_query_path_editor.cc
- recorder/kis_recorded_action_creator.cc
- recorder/kis_recorded_action_creator_factory.cc
- recorder/kis_recorded_action_creator_factory_registry.cc
- recorder/kis_recorded_action_editor_factory.cc
- recorder/kis_recorded_action_editor_factory_registry.cc
- recorder/kis_recorded_filter_action_editor.cc
- recorder/kis_recorded_filter_action_creator.cpp
- recorder/kis_recorded_paint_action_editor.cc
tool/kis_selection_tool_helper.cpp
tool/kis_selection_tool_config_widget_helper.cpp
tool/kis_rectangle_constraint_widget.cpp
@@ -187,7 +178,6 @@ set(kritaui_LIB_SRCS
tool/kis_tool_freehand_helper.cpp
tool/kis_tool_multihand_helper.cpp
tool/kis_figure_painting_tool_helper.cpp
- tool/kis_recording_adapter.cpp
tool/kis_tool_paint.cc
tool/kis_tool_shape.cc
tool/kis_tool_ellipse_base.cpp
@@ -491,7 +481,6 @@ ki18n_wrap_ui(kritaui_LIB_SRCS
forms/wdgdlgfilelayer.ui
forms/wdgfilterselector.ui
forms/wdgfilternodecreation.ui
- forms/wdgpaintactioneditor.ui
forms/wdgmultipliersdoublesliderspinbox.ui
forms/wdgnodequerypatheditor.ui
forms/wdgpresetselectorstrip.ui
diff --git a/libs/ui/forms/wdgpaintactioneditor.ui b/libs/ui/forms/wdgpaintactioneditor.ui
deleted file mode 100644
index deac79f578e..00000000000
--- a/libs/ui/forms/wdgpaintactioneditor.ui
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>WdgPaintActionEditor</class>
- <widget class="QWidget" name="WdgPaintActionEditor">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>405</width>
- <height>376</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="KisNodeQueryPathEditor" name="nodeQueryPathEditor" native="true"/>
- </item>
- <item row="1" column="0">
- <widget class="QTabWidget" name="tabWidget">
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string>Options</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Paint color:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Background color:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>236</width>
- <height>147</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Opacity:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="KisIntParseSpinBox" name="opacity">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimum">
- <number>0</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="sliderEnabled" stdset="0">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KisColorButton" name="paintColor">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KisColorButton" name="backgroundColor">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_2">
- <attribute name="title">
- <string>Current preset</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Paint op:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="paintOps">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QFrame" name="frmOptionWidgetContainer">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>4</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_3">
- <attribute name="title">
- <string>Preset Collection</string>
- </attribute>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="KisPresetChooser" name="wdgPresetChooser" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>4</horstretch>
- <verstretch>4</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>KisColorButton</class>
- <extends>QPushButton</extends>
- <header>kis_color_button.h</header>
- </customwidget>
- <customwidget>
- <class>KisIntParseSpinBox</class>
- <extends>QSpinBox</extends>
- <header>kis_int_parse_spin_box.h</header>
- </customwidget>
- <customwidget>
- <class>KisPresetChooser</class>
- <extends>QWidget</extends>
- <header>widgets/kis_preset_chooser.h</header>
- <container>1</container>
- </customwidget>
- <customwidget>
- <class>KisNodeQueryPathEditor</class>
- <extends>QWidget</extends>
- <header>recorder/kis_node_query_path_editor.h</header>
- <container>1</container>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/libs/ui/kis_selection_manager.cc b/libs/ui/kis_selection_manager.cc
index 1f04c273763..22ad36152c7 100644
--- a/libs/ui/kis_selection_manager.cc
+++ b/libs/ui/kis_selection_manager.cc
@@ -91,7 +91,6 @@
#include "kis_action_manager.h"
#include "operations/kis_operation_configuration.h"
//new
-#include "kis_recorded_path_paint_action.h"
#include "kis_node_query_path.h"
#include "kis_tool_shape.h"
diff --git a/libs/ui/recorder/kis_node_query_path_editor.cc b/libs/ui/recorder/kis_node_query_path_editor.cc
deleted file mode 100644
index 36db465c7a6..00000000000
--- a/libs/ui/recorder/kis_node_query_path_editor.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_node_query_path_editor.h"
-
-#include "ui_wdgnodequerypatheditor.h"
-#include <QWhatsThis>
-#include <recorder/kis_node_query_path.h>
-#include <kis_icon.h>
-
-struct KisNodeQueryPathEditor::Private
-{
- Ui_WdgNodeQueryPathEditor form;
-};
-
-KisNodeQueryPathEditor::KisNodeQueryPathEditor(QWidget* parent) : QWidget(parent), d(new Private)
-{
- d->form.setupUi(this);
-
- connect(d->form.radioButtonCurrentLayer, SIGNAL(clicked(bool)), SLOT(currentLayerEnabled(bool)));
- connect(d->form.radioButtonCustomPath, SIGNAL(clicked(bool)), SLOT(customPathEnabled(bool)));
-
- d->form.kpushbutton->setIcon(KisIconUtils::loadIcon("system-help"));
- connect(d->form.kpushbutton, SIGNAL(clicked()), this, SLOT(slotPopupQuickHelp()));
- currentLayerEnabled(true);
-
- connect(d->form.klineeditPath, SIGNAL(textChanged(QString)), SIGNAL(nodeQueryPathChanged()));
-}
-
-KisNodeQueryPathEditor::~KisNodeQueryPathEditor()
-{
- delete d;
-}
-
-void KisNodeQueryPathEditor::setNodeQueryPath(const KisNodeQueryPath& path)
-{
- if(path.toString() == ".")
- {
- d->form.radioButtonCurrentLayer->setChecked(true);
- currentLayerEnabled(true);
- } else {
- d->form.radioButtonCustomPath->setChecked(true);
- customPathEnabled(true);
- d->form.klineeditPath->setText(path.toString());
- }
-}
-
-KisNodeQueryPath KisNodeQueryPathEditor::nodeQueryPath() const
-{
- return KisNodeQueryPath::fromString(d->form.klineeditPath->text());
-}
-
-void KisNodeQueryPathEditor::currentLayerEnabled(bool v)
-{
- if(!v) return;
- d->form.klineeditPath->setEnabled(false);
- d->form.kpushbutton->setEnabled(false);
- d->form.klineeditPath->setText(".");
-}
-
-void KisNodeQueryPathEditor::customPathEnabled(bool v)
-{
- if(!v) return;
- d->form.klineeditPath->setEnabled(true);
- d->form.kpushbutton->setEnabled(true);
-}
-
-void KisNodeQueryPathEditor::slotPopupQuickHelp()
-{
- QWhatsThis::showText(QCursor::pos(), i18n(
- "<b>/</b> represents the root of the image, or a separator<br/>\n"
- "<b>a number</b> represents a layer<br/>\n"
- "<b>.</b> represents the current layer<br/>\n"
- "<b>..</b> represents the parent layer<br/>\n\n"
- "<b>Examples:</b><br/>\n"
- "<i>/0</i> represents the bottom layer of the image<br/>\n"
- "<i>../1</i> represents the second layer from the bottom of the parent of the current layer<br/>\n"
- "<i>./0</i> represents the first child of the current layer" ) );
-}
-
diff --git a/libs/ui/recorder/kis_node_query_path_editor.h b/libs/ui/recorder/kis_node_query_path_editor.h
deleted file mode 100644
index cfea6ea7b54..00000000000
--- a/libs/ui/recorder/kis_node_query_path_editor.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_NODE_QUERY_PATH_EDITOR_H_
-#define _KIS_NODE_QUERY_PATH_EDITOR_H_
-
-#include <QWidget>
-
-class KisNodeQueryPath;
-/**
- * This class is used to edit @ref KisNodeQueryPath
- */
-class KisNodeQueryPathEditor : public QWidget
-{
- Q_OBJECT
-public:
- KisNodeQueryPathEditor(QWidget* parent);
- ~KisNodeQueryPathEditor() override;
- void setNodeQueryPath(const KisNodeQueryPath& path);
- /**
- * Generate a node query path based on the state of the widgets
- */
- KisNodeQueryPath nodeQueryPath() const;
-Q_SIGNALS:
- void nodeQueryPathChanged();
-private Q_SLOTS:
- void currentLayerEnabled(bool v);
- void customPathEnabled(bool v);
- void slotPopupQuickHelp();
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_creator.cc b/libs/ui/recorder/kis_recorded_action_creator.cc
deleted file mode 100644
index 20157d4fbcf..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_creator.h"
-
-KisRecordedActionCreator::KisRecordedActionCreator(QWidget* parent, Qt::WindowFlags f)
- : QWidget(parent, f)
- , d(0)
-{
-}
-
-KisRecordedActionCreator::~KisRecordedActionCreator()
-{
- // delete d;
-}
-
diff --git a/libs/ui/recorder/kis_recorded_action_creator.h b/libs/ui/recorder/kis_recorded_action_creator.h
deleted file mode 100644
index bf3677f2e8a..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-#ifndef KIS_RECORDED_ACTION_CREATOR
-#define KIS_RECORDED_ACTION_CREATOR
-#include <QWidget>
-
-class KisRecordedAction;
-
-class KisRecordedActionCreator : public QWidget {
-public:
- explicit KisRecordedActionCreator(QWidget* parent = 0, Qt::WindowFlags f = 0);
- ~KisRecordedActionCreator() override;
- /**
- * This function is called when the dialog is closed and the action has to be created
- * from the parameters in the widget.
- */
- virtual KisRecordedAction* createAction() const = 0;
-private:
- struct Private;
- Private * const d;
-};
-
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_creator_factory.cc b/libs/ui/recorder/kis_recorded_action_creator_factory.cc
deleted file mode 100644
index afd9f8f9662..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator_factory.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2009,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_creator_factory.h"
-
-#include <QString>
-
-struct KisRecordedActionCreatorFactory::Private {
- QString id;
- QString name;
-};
-
-KisRecordedActionCreatorFactory::KisRecordedActionCreatorFactory(const QString& _id, const QString& _name) : d(new Private)
-{
- d->id = _id;
- d->name = _name;
-}
-
-KisRecordedActionCreatorFactory::~KisRecordedActionCreatorFactory()
-{
- delete d;
-}
-
-QString KisRecordedActionCreatorFactory::id() const
-{
- return d->id;
-}
-
-QString KisRecordedActionCreatorFactory::name() const
-{
- return d->name;
-}
-
-KisRecordedActionCreator* KisRecordedActionCreatorFactory::createCreator(QWidget* /*parent*/) const
-{
- Q_ASSERT(requireCreator() == false);
- return 0;
-}
-
-KisRecordedAction* KisRecordedActionCreatorFactory::createAction() const
-{
- Q_ASSERT(requireCreator() == true);
- return 0;
-}
diff --git a/libs/ui/recorder/kis_recorded_action_creator_factory.h b/libs/ui/recorder/kis_recorded_action_creator_factory.h
deleted file mode 100644
index cd2d17c6832..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator_factory.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2009,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_CREATOR_FACTORY_H_
-#define _KIS_RECORDED_ACTION_CREATOR_FACTORY_H_
-
-#include <kritaui_export.h>
-
-class KisRecordedAction;
-class KisRecordedActionCreator;
-class QString;
-class QWidget;
-
-/**
- * This class allows to create widgets that are used to create new actions.
- */
-class KRITAUI_EXPORT KisRecordedActionCreatorFactory
-{
-public:
- KisRecordedActionCreatorFactory(const QString& _id, const QString& _name);
- virtual ~KisRecordedActionCreatorFactory();
- QString id() const;
- QString name() const;
- /**
- * @return true if the creation of this action require the use of a creator widget
- */
- virtual bool requireCreator() const = 0;
- /**
- * Create an creator for the action.
- */
- virtual KisRecordedActionCreator* createCreator(QWidget* parent) const;
- /**
- * Create an action. If the action require a creator, it should return 0.
- */
- virtual KisRecordedAction* createAction() const;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_creator_factory_registry.cc b/libs/ui/recorder/kis_recorded_action_creator_factory_registry.cc
deleted file mode 100644
index ab0e0f87620..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator_factory_registry.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2009,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_creator_factory_registry.h"
-
-#include <KoGenericRegistry.h>
-
-#include <QtAlgorithms>
-#include <QList>
-#include <QWidget>
-#include <QGlobalStatic>
-
-#include <kis_debug.h>
-#include "kis_recorded_action_creator_factory.h"
-#include "kis_recorded_filter_action_creator.h"
-
-Q_GLOBAL_STATIC(KisRecordedActionCreatorFactoryRegistry, s_instance)
-
-struct KisRecordedActionCreatorFactoryRegistry::Private {
- KoGenericRegistry<KisRecordedActionCreatorFactory*> factories;
-};
-
-KisRecordedActionCreatorFactoryRegistry::KisRecordedActionCreatorFactoryRegistry()
- : d(new Private)
-{
- add(new KisRecordedFilterActionCreatorFactory);
-}
-
-KisRecordedActionCreatorFactoryRegistry::~KisRecordedActionCreatorFactoryRegistry()
-{
- delete d;
-}
-
-KisRecordedActionCreatorFactoryRegistry* KisRecordedActionCreatorFactoryRegistry::instance()
-{
- return s_instance;
-}
-
-void KisRecordedActionCreatorFactoryRegistry::add(KisRecordedActionCreatorFactory* factory)
-{
- d->factories.add(factory);
-}
-
-KisRecordedActionCreatorFactory* KisRecordedActionCreatorFactoryRegistry::get(const QString& _id) const
-{
- return d->factories.get(_id);
-}
-
-QList<KoID> KisRecordedActionCreatorFactoryRegistry::creators() const
-{
- QList<KoID> cs;
- Q_FOREACH (const QString &id, d->factories.keys())
- {
- cs.push_back(KoID(id, d->factories.get(id)->name()));
- }
- return cs;
-}
diff --git a/libs/ui/recorder/kis_recorded_action_creator_factory_registry.h b/libs/ui/recorder/kis_recorded_action_creator_factory_registry.h
deleted file mode 100644
index 5e1e4c48b2f..00000000000
--- a/libs/ui/recorder/kis_recorded_action_creator_factory_registry.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2009,2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_CREATOR_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_CREATOR_FACTORY_REGISTRY_H_
-
-#include <kritaui_export.h>
-#include <KoID.h>
-
-class KisRecordedActionCreatorFactory;
-
-/**
- * This class allow to create a creator for a specific recorded action.
- *
- */
-class KRITAUI_EXPORT KisRecordedActionCreatorFactoryRegistry
-{
-public:
- KisRecordedActionCreatorFactoryRegistry();
- ~KisRecordedActionCreatorFactoryRegistry();
- static KisRecordedActionCreatorFactoryRegistry* instance();
- /**
- * Add a factory of action creator.
- */
- void add(KisRecordedActionCreatorFactory* factory);
- /**
- * @return an creator for the given action, or a null pointer if there is
- * no factory for that action.
- */
- KisRecordedActionCreatorFactory* get(const QString& _id) const;
- /**
- * @return the list of creators
- */
- QList<KoID> creators() const;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory.cc b/libs/ui/recorder/kis_recorded_action_editor_factory.cc
deleted file mode 100644
index dc46c9a7357..00000000000
--- a/libs/ui/recorder/kis_recorded_action_editor_factory.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_editor_factory.h"
-
-struct KisRecordedActionEditorFactory::Private {
-
-};
-
-KisRecordedActionEditorFactory::KisRecordedActionEditorFactory() : d(new Private)
-{
-}
-
-KisRecordedActionEditorFactory::~KisRecordedActionEditorFactory()
-{
- delete d;
-}
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory.h b/libs/ui/recorder/kis_recorded_action_editor_factory.h
deleted file mode 100644
index 1c906569a62..00000000000
--- a/libs/ui/recorder/kis_recorded_action_editor_factory.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_EDITOR_FACTORY_H_
-#define _KIS_RECORDED_ACTION_EDITOR_FACTORY_H_
-
-#include <kritaui_export.h>
-
-class QWidget;
-class KisRecordedAction;
-
-/**
- * This class allow to create widget that can edit a @ref KisRecordedAction
- */
-class KRITAUI_EXPORT KisRecordedActionEditorFactory
-{
-public:
- KisRecordedActionEditorFactory();
- virtual ~KisRecordedActionEditorFactory();
- /**
- * Create an editor for the action.
- * The widget is expected to have a 'actionChanged' signal that is emitted
- * when the editor has changed one of the parameter of the action.
- */
- virtual QWidget* createEditor(QWidget* parent, KisRecordedAction* action) const = 0;
- /**
- * @return true if this factory can create an editor for the given action.
- */
- virtual bool canEdit(const KisRecordedAction* action) const = 0;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory_registry.cc b/libs/ui/recorder/kis_recorded_action_editor_factory_registry.cc
deleted file mode 100644
index 14e6d2f4098..00000000000
--- a/libs/ui/recorder/kis_recorded_action_editor_factory_registry.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_editor_factory_registry.h"
-
-#include <QtAlgorithms>
-#include <QList>
-#include <QWidget>
-#include <QGlobalStatic>
-
-#include <kis_debug.h>
-#include "kis_recorded_action_editor_factory.h"
-#include "kis_recorded_filter_action_editor.h"
-#include "kis_recorded_paint_action_editor.h"
-
-Q_GLOBAL_STATIC(KisRecordedActionEditorFactoryRegistry, s_instance)
-
-struct KisRecordedActionEditorFactoryRegistry::Private {
- QList< KisRecordedActionEditorFactory* > factories;
-};
-
-KisRecordedActionEditorFactoryRegistry::KisRecordedActionEditorFactoryRegistry()
- : d(new Private)
-{
- add(new KisRecordedFilterActionEditorFactory);
- add(new KisRecordedPaintActionEditorFactory);
-}
-
-KisRecordedActionEditorFactoryRegistry::~KisRecordedActionEditorFactoryRegistry()
-{
- dbgRegistry << "Deleting KisRecordedActionEditorFactoryRegistry";
- qDeleteAll(d->factories);
- delete d;
-}
-
-KisRecordedActionEditorFactoryRegistry* KisRecordedActionEditorFactoryRegistry::instance()
-{
- return s_instance;
-}
-
-void KisRecordedActionEditorFactoryRegistry::add(KisRecordedActionEditorFactory* factory)
-{
- if (d->factories.contains(factory)) return;
- d->factories.push_front(factory);
-}
-
-QWidget* KisRecordedActionEditorFactoryRegistry::createEditor(QWidget* parent, KisRecordedAction* action) const
-{
- Q_FOREACH (KisRecordedActionEditorFactory* factory, d->factories) {
- if (factory->canEdit(action)) {
- QWidget* editor = factory->createEditor(parent, action);
- Q_ASSERT(editor);
- Q_ASSERT(editor->metaObject()->indexOfSignal("actionEdited()") != -1);
- return editor;
- }
- }
- return 0;
-}
-
-bool KisRecordedActionEditorFactoryRegistry::hasEditor(KisRecordedAction* action) const
-{
- Q_FOREACH (KisRecordedActionEditorFactory* factory, d->factories) {
- if (factory->canEdit(action)) {
- return true;
- }
- }
- return false;
-}
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory_registry.h b/libs/ui/recorder/kis_recorded_action_editor_factory_registry.h
deleted file mode 100644
index a5279d1fdfc..00000000000
--- a/libs/ui/recorder/kis_recorded_action_editor_factory_registry.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_EDITOR_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_EDITOR_FACTORY_REGISTRY_H_
-
-#include <kritaui_export.h>
-
-class QWidget;
-class KisRecordedAction;
-class KisRecordedActionEditorFactory;
-
-/**
- * This class allow to create an editor for a specific recorded action.
- *
- * If two editors can edit the same type of action, then the editor that
- * was added last is used in priority.
- */
-class KRITAUI_EXPORT KisRecordedActionEditorFactoryRegistry
-{
-public:
- KisRecordedActionEditorFactoryRegistry();
- ~KisRecordedActionEditorFactoryRegistry();
- static KisRecordedActionEditorFactoryRegistry* instance();
- /**
- * Add a factory of action editor.
- */
- void add(KisRecordedActionEditorFactory* factory);
- /**
- * @return an editor for the given action, or a null pointer if there is
- * no factory for that action.
- */
- QWidget* createEditor(QWidget* parent, KisRecordedAction* action) const;
- /**
- * @return true if there is an editor for this action.
- */
- bool hasEditor(KisRecordedAction* action) const;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_filter_action_creator.cpp b/libs/ui/recorder/kis_recorded_filter_action_creator.cpp
deleted file mode 100644
index fcdf6d4ef59..00000000000
--- a/libs/ui/recorder/kis_recorded_filter_action_creator.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_filter_action_creator.h"
-
-#include <QGridLayout>
-#include <QHeaderView>
-
-#include <klocalizedstring.h>
-
-#include <filter/kis_filter.h>
-#include <kis_paint_device.h>
-#include <kis_filter_selector_widget.h>
-#include <kis_filters_model.h>
-#include <recorder/kis_recorded_filter_action.h>
-#include <recorder/kis_node_query_path.h>
-#include <kis_filter_configuration.h>
-
-KisRecordedFilterActionCreator::KisRecordedFilterActionCreator(QWidget* parent , Qt::WindowFlags f)
- : KisRecordedActionCreator(parent, f)
-{
- m_filterModel = new KisFiltersModel(true, 0);
- m_filterTree = new QTreeView(this);
- m_filterTree->setModel(m_filterModel);
- m_filterTree->header()->setVisible(false);
- QGridLayout* layout = new QGridLayout();
- setLayout(layout);
- layout->addWidget(m_filterTree, 0, 0, 1, 1);
-}
-
-KisRecordedFilterActionCreator::~KisRecordedFilterActionCreator()
-{
- delete m_filterTree;
- delete m_filterModel;
-}
-
-KisRecordedAction* KisRecordedFilterActionCreator::createAction() const
-{
- const KisFilter* filter = m_filterModel->indexToFilter(m_filterTree->currentIndex());
- if(!filter) return 0;
- return new KisRecordedFilterAction(filter->name(), KisNodeQueryPath::fromString(""), filter, filter->defaultConfiguration());
-}
-
-
-KisRecordedFilterActionCreatorFactory::KisRecordedFilterActionCreatorFactory()
- : KisRecordedActionCreatorFactory("filter", i18nc("recorded filter action", "Apply Filter"))
-{
-}
-
-KisRecordedFilterActionCreatorFactory::~KisRecordedFilterActionCreatorFactory()
-{
-}
-
-bool KisRecordedFilterActionCreatorFactory::requireCreator() const
-{
- return true;
-}
-
-KisRecordedActionCreator* KisRecordedFilterActionCreatorFactory::createCreator(QWidget* parent) const
-{
- return new KisRecordedFilterActionCreator(parent);
-}
diff --git a/libs/ui/recorder/kis_recorded_filter_action_creator.h b/libs/ui/recorder/kis_recorded_filter_action_creator.h
deleted file mode 100644
index d329ea238c0..00000000000
--- a/libs/ui/recorder/kis_recorded_filter_action_creator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_FILTER_ACTION_CREATOR_FACTORY_H_
-#define _KIS_RECORDED_FILTER_ACTION_CREATOR_FACTORY_H_
-
-#include "kis_recorded_action_creator.h"
-#include "kis_recorded_action_creator_factory.h"
-
-class KisFiltersModel;
-class QTreeView;
-
-class KisRecordedFilterActionCreator : public KisRecordedActionCreator {
-public:
- explicit KisRecordedFilterActionCreator(QWidget* parent = 0, Qt::WindowFlags f = 0);
- ~KisRecordedFilterActionCreator() override;
- KisRecordedAction* createAction() const override;
-private:
- KisFiltersModel* m_filterModel;
- QTreeView* m_filterTree;
-};
-
-/**
- * This class allows to create widgets that are used to create new actions.
- */
-class KisRecordedFilterActionCreatorFactory : public KisRecordedActionCreatorFactory
-{
-public:
- KisRecordedFilterActionCreatorFactory();
- ~KisRecordedFilterActionCreatorFactory() override;
- bool requireCreator() const override;
- KisRecordedActionCreator* createCreator(QWidget* parent) const override;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_filter_action_editor.cc b/libs/ui/recorder/kis_recorded_filter_action_editor.cc
deleted file mode 100644
index 82a39ae6799..00000000000
--- a/libs/ui/recorder/kis_recorded_filter_action_editor.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-
-#include <kis_filter_configuration.h>
-#include "kis_recorded_filter_action_editor.h"
-#include <recorder/kis_recorded_filter_action.h>
-#include <filter/kis_filter.h>
-#include <QGridLayout>
-#include <kis_config_widget.h>
-#include <filter/kis_filter_configuration.h>
-#include <QLabel>
-#include <kis_paint_device.h>
-#include "kis_node_query_path_editor.h"
-#include <KoColorSpaceRegistry.h>
-#include <recorder/kis_node_query_path.h>
-
-KisRecordedFilterActionEditor::KisRecordedFilterActionEditor(QWidget* parent, KisRecordedAction* action)
- : QWidget(parent)
- , m_action(dynamic_cast<KisRecordedFilterAction*>(action))
- , m_gridLayout(new QGridLayout(this))
-{
- Q_ASSERT(m_action);
-
- // Create the node query path editor
- m_nodeQueryPathEditor = new KisNodeQueryPathEditor(this);
- m_nodeQueryPathEditor->setNodeQueryPath(m_action->nodeQueryPath());
- connect(m_nodeQueryPathEditor, SIGNAL(nodeQueryPathChanged()), SLOT(nodeQueryPathChanged()));
- m_gridLayout->addWidget(m_nodeQueryPathEditor, 1, 0);
-
- // Create the filter editor
- m_configWidget = m_action->filter()->createConfigurationWidget(this, new KisPaintDevice(KoColorSpaceRegistry::instance()->rgb8()));
- if (m_configWidget) {
- m_gridLayout->addWidget(m_configWidget);
-
- // FIXME: pass the view object to the config widget
- //m_configWidget->setView(view);
-
- m_configWidget->setConfiguration(m_action->filterConfiguration());
- connect(m_configWidget, SIGNAL(sigConfigurationItemChanged()), SLOT(configurationUpdated()));
- } else {
- m_gridLayout->addWidget(new QLabel(i18n("No configuration option."), this));
- }
-}
-
-KisRecordedFilterActionEditor::~KisRecordedFilterActionEditor()
-{
-}
-
-void KisRecordedFilterActionEditor::configurationUpdated()
-{
- KisFilterConfigurationSP config = dynamic_cast<KisFilterConfiguration*>(m_configWidget->configuration().data());
- if (config) {
- m_action->setFilterConfiguration(config);
- emit(actionEdited());
- }
-}
-
-void KisRecordedFilterActionEditor::nodeQueryPathChanged()
-{
- m_action->setNodeQueryPath(m_nodeQueryPathEditor->nodeQueryPath());
- emit(actionEdited());
-}
-
-KisRecordedFilterActionEditorFactory::KisRecordedFilterActionEditorFactory()
-{
-}
-
-KisRecordedFilterActionEditorFactory::~KisRecordedFilterActionEditorFactory()
-{
-}
-
-QWidget* KisRecordedFilterActionEditorFactory::createEditor(QWidget* parent, KisRecordedAction* action) const
-{
- return new KisRecordedFilterActionEditor(parent, action);
-}
-
-bool KisRecordedFilterActionEditorFactory::canEdit(const KisRecordedAction* action) const
-{
- return action->id() == "FilterAction";
-}
-
diff --git a/libs/ui/recorder/kis_recorded_filter_action_editor.h b/libs/ui/recorder/kis_recorded_filter_action_editor.h
deleted file mode 100644
index 3f034bacae6..00000000000
--- a/libs/ui/recorder/kis_recorded_filter_action_editor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_FILTER_ACTION_EDITOR_H_
-#define _KIS_RECORDED_FILTER_ACTION_EDITOR_H_
-
-#include <QWidget>
-#include "kis_recorded_action_editor_factory.h"
-
-class KisNodeQueryPathEditor;
-class KisRecordedFilterAction;
-class QGridLayout;
-class KisConfigWidget;
-
-class KisRecordedFilterActionEditor : public QWidget
-{
- Q_OBJECT
-public:
- KisRecordedFilterActionEditor(QWidget* parent, KisRecordedAction* action);
- ~KisRecordedFilterActionEditor() override;
-private Q_SLOTS:
- void configurationUpdated();
- void nodeQueryPathChanged();
-Q_SIGNALS:
- void actionEdited();
-private:
- KisRecordedFilterAction* m_action;
- QGridLayout* m_gridLayout;
- KisConfigWidget* m_configWidget;
- KisNodeQueryPathEditor* m_nodeQueryPathEditor;
-};
-
-class KisRecordedFilterActionEditorFactory : public KisRecordedActionEditorFactory
-{
-public:
- KisRecordedFilterActionEditorFactory();
- ~KisRecordedFilterActionEditorFactory() override;
- QWidget* createEditor(QWidget* parent, KisRecordedAction* action) const override;
- bool canEdit(const KisRecordedAction* action) const override;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_paint_action_editor.cc b/libs/ui/recorder/kis_recorded_paint_action_editor.cc
deleted file mode 100644
index d18e2b59e67..00000000000
--- a/libs/ui/recorder/kis_recorded_paint_action_editor.cc
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_paint_action_editor.h"
-
-#include <QLabel>
-#include <QGridLayout>
-
-#include <KoColor.h>
-
-#include "recorder/kis_recorded_paint_action.h"
-#include <brushengine/kis_paintop_preset.h>
-#include <brushengine/kis_paintop_registry.h>
-#include <brushengine/kis_paintop_config_widget.h>
-
-#include "ui_wdgpaintactioneditor.h"
-#include <KoColorSpaceRegistry.h>
-#include <KoResourcePaths.h>
-#include "kis_node_query_path_editor.h"
-#include <recorder/kis_node_query_path.h>
-
-KisRecordedPaintActionEditor::KisRecordedPaintActionEditor(QWidget* parent, KisRecordedAction* action) : QWidget(parent),
- m_action(dynamic_cast<KisRecordedPaintAction*>(action)),
- m_actionEditor(new Ui_WdgPaintActionEditor),
- m_configWidget(0)
-{
- Q_ASSERT(m_action);
- m_actionEditor->setupUi(this);
-
- // Setup paint color editor
- m_actionEditor->paintColor->setColor(m_action->paintColor());
- connect(m_actionEditor->paintColor, SIGNAL(changed(KoColor)),
- this, SLOT(configurationUpdated()));
-
- // Setup background color editor
- m_actionEditor->backgroundColor->setColor(m_action->backgroundColor());
- connect(m_actionEditor->backgroundColor, SIGNAL(changed(KoColor)),
- this, SLOT(configurationUpdated()));
-
- // Setup opacity
- m_actionEditor->opacity->setValue(m_action->opacity() * 100.0);
- connect(m_actionEditor->opacity, SIGNAL(valueChanged(int)), SLOT(configurationUpdated()));
-
- // Setup paint ops
-
- QList<KoID> keys = KisPaintOpRegistry::instance()->listKeys();
- Q_FOREACH (const KoID& paintopId, keys) {
- QIcon pm = KisPaintOpRegistry::instance()->icon(paintopId);
-
- m_actionEditor->paintOps->addItem(pm, paintopId.name());
- m_paintops.append(paintopId.id());
- }
- connect(m_actionEditor->paintOps, SIGNAL(activated(int)), SLOT(paintOpChanged(int)));
-
- // Setup configuration widget for paint op settings
- m_gridLayout = new QGridLayout(m_actionEditor->frmOptionWidgetContainer);
- setPaintOpPreset();
- m_actionEditor->paintOps->setCurrentIndex(m_paintops.indexOf(m_action->paintOpPreset()->paintOp().id()));
- m_paintOpsToPreset[m_action->paintOpPreset()->paintOp().id()] = m_action->paintOpPreset();
- connect(m_actionEditor->wdgPresetChooser, SIGNAL(resourceSelected(KoResource*)), SLOT(resourceSelected(KoResource*)));
-
- // Setup the query path editor
- m_actionEditor->nodeQueryPathEditor->setNodeQueryPath(m_action->nodeQueryPath());
- connect(m_actionEditor->nodeQueryPathEditor, SIGNAL(nodeQueryPathChanged()), SLOT(nodeQueryPathChanged()));
-
-}
-
-KisRecordedPaintActionEditor::~KisRecordedPaintActionEditor()
-{
- delete m_actionEditor;
-}
-
-void KisRecordedPaintActionEditor::configurationUpdated()
-{
- m_configWidget->writeConfigurationSafe(const_cast<KisPaintOpSettings*>(m_action->paintOpPreset()->settings().data()));
-
- m_action->setPaintColor(m_actionEditor->paintColor->color());
- m_action->setBackgroundColor(m_actionEditor->backgroundColor->color());
- m_action->setOpacity(m_actionEditor->opacity->value() / qreal(100.0));
-
- emit(actionEdited());
-}
-
-void KisRecordedPaintActionEditor::paintOpChanged(int index)
-{
- QString id = m_paintops[index];
- KisPaintOpPresetSP preset = m_paintOpsToPreset[id];
- if (!preset) {
- preset = KisPaintOpRegistry::instance()->defaultPreset(KoID(id, ""));
- m_paintOpsToPreset[id] = preset;
- }
- m_action->setPaintOpPreset(preset);
- setPaintOpPreset();
-}
-
-void KisRecordedPaintActionEditor::resourceSelected(KoResource* resource)
-{
- KisPaintOpPresetSP preset = static_cast<KisPaintOpPreset*>(resource);
-
- m_paintOpsToPreset[preset->paintOp().id()] = preset;
- m_action->setPaintOpPreset(preset);
- setPaintOpPreset();
-}
-
-void KisRecordedPaintActionEditor::nodeQueryPathChanged()
-{
- m_action->setNodeQueryPath(m_actionEditor->nodeQueryPathEditor->nodeQueryPath());
- emit(actionEdited());
-}
-
-
-void KisRecordedPaintActionEditor::setPaintOpPreset()
-{
- delete m_configWidget;
- m_configWidget = KisPaintOpRegistry::instance()->get(m_action->paintOpPreset()->paintOp().id())->createConfigWidget(m_actionEditor->frmOptionWidgetContainer);
- if (m_configWidget) {
- m_gridLayout->addWidget(m_configWidget);
- //TODO use default configuration instead?
- //m_configWidget->setConfiguration(m_action->paintOpPreset()->settings());
- connect(m_configWidget, SIGNAL(sigConfigurationUpdated()), SLOT(configurationUpdated()));
- } else {
- m_gridLayout->addWidget(new QLabel(i18n("No configuration option."), this));
- }
-}
-
-KisRecordedPaintActionEditorFactory::KisRecordedPaintActionEditorFactory()
-{
-}
-
-KisRecordedPaintActionEditorFactory::~KisRecordedPaintActionEditorFactory()
-{
-}
-
-QWidget* KisRecordedPaintActionEditorFactory::createEditor(QWidget* parent, KisRecordedAction* action) const
-{
- return new KisRecordedPaintActionEditor(parent, action);
-}
-
-bool KisRecordedPaintActionEditorFactory::canEdit(const KisRecordedAction* action) const
-{
- return dynamic_cast<const KisRecordedPaintAction*>(action);
-}
-
diff --git a/libs/ui/recorder/kis_recorded_paint_action_editor.h b/libs/ui/recorder/kis_recorded_paint_action_editor.h
deleted file mode 100644
index 5eeaaf79a4e..00000000000
--- a/libs/ui/recorder/kis_recorded_paint_action_editor.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2010 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_PAINT_ACTION_EDITOR_H_
-#define _KIS_RECORDED_PAINT_ACTION_EDITOR_H_
-
-#include <QWidget>
-#include "kis_recorded_action_editor_factory.h"
-#include "kis_types.h"
-
-class QGridLayout;
-class KoColorPopupAction;
-class KisPaintOpConfigWidget;
-class KisRecordedPaintAction;
-class Ui_WdgPaintActionEditor;
-class KoResource;
-
-/**
- * This is the editor for all \ref KisRecordedPaintAction
- */
-class KisRecordedPaintActionEditor : public QWidget
-{
- Q_OBJECT
-public:
- KisRecordedPaintActionEditor(QWidget* parent, KisRecordedAction* action);
- ~KisRecordedPaintActionEditor() override;
-private Q_SLOTS:
- void configurationUpdated();
- void paintOpChanged(int index);
- void resourceSelected(KoResource* resource);
- void nodeQueryPathChanged();
-Q_SIGNALS:
- void actionEdited();
-private:
- void setPaintOpPreset();
- KisRecordedPaintAction* m_action;
- Ui_WdgPaintActionEditor* m_actionEditor;
- KisPaintOpConfigWidget* m_configWidget;
- QGridLayout* m_gridLayout;
- QList<QString> m_paintops;
- QMap<QString, KisPaintOpPresetSP> m_paintOpsToPreset;
-};
-
-class KisRecordedPaintActionEditorFactory : public KisRecordedActionEditorFactory
-{
-public:
- KisRecordedPaintActionEditorFactory();
- ~KisRecordedPaintActionEditorFactory() override;
- QWidget* createEditor(QWidget* parent, KisRecordedAction* action) const override;
- bool canEdit(const KisRecordedAction* action) const override;
-};
-
-#endif
diff --git a/libs/ui/tests/CMakeLists.txt b/libs/ui/tests/CMakeLists.txt
index 148486fa22f..df77a02ec90 100644
--- a/libs/ui/tests/CMakeLists.txt
+++ b/libs/ui/tests/CMakeLists.txt
@@ -11,7 +11,6 @@ macro_add_unittest_definitions()
ecm_add_tests(
kis_image_view_converter_test.cpp
kis_shape_selection_test.cpp
- kis_recorded_action_editor_test.cpp
kis_doc2_test.cpp
kis_coordinates_converter_test.cpp
kis_grid_config_test.cpp
diff --git a/libs/ui/tests/kis_recorded_action_editor_test.cpp b/libs/ui/tests/kis_recorded_action_editor_test.cpp
deleted file mode 100644
index 3d00ce8d401..00000000000
--- a/libs/ui/tests/kis_recorded_action_editor_test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recorded_action_editor_test.h"
-
-#include <QTest>
-
-#include <QTest>
-#include <QCoreApplication>
-#include <recorder/kis_recorded_action_editor_factory_registry.h>
-#include <recorder/kis_recorded_filter_action.h>
-#include <filter/kis_filter_registry.h>
-#include <filter/kis_filter.h>
-#include <kis_paint_device.h>
-#include <recorder/kis_node_query_path.h>
-
-void KisRecordedActionEditorTest::testFilterEditorCreation()
-{
- KisRecordedActionEditorFactoryRegistry* reg = KisRecordedActionEditorFactoryRegistry::instance();
- const KisFilter* blurFilter = KisFilterRegistry::instance()->get("blur");
- KisRecordedFilterAction* blurFilterAction = new KisRecordedFilterAction(
- "hello", KisNodeQueryPath::fromString(""), blurFilter, blurFilter->defaultConfiguration());
- QVERIFY(reg->hasEditor(blurFilterAction));
- QVERIFY(reg->createEditor(0, blurFilterAction));
- const KisFilter* invertFilter = KisFilterRegistry::instance()->get("invert");
- KisRecordedFilterAction* invertFilterAction = new KisRecordedFilterAction(
- "hello", KisNodeQueryPath::fromString(""), invertFilter, invertFilter->defaultConfiguration());
- QVERIFY(reg->hasEditor(invertFilterAction));
- QVERIFY(reg->createEditor(0, invertFilterAction));
-}
-
-
-QTEST_MAIN(KisRecordedActionEditorTest)
-
diff --git a/libs/ui/tests/kis_recorded_action_editor_test.h b/libs/ui/tests/kis_recorded_action_editor_test.h
deleted file mode 100644
index 74b605a0ee2..00000000000
--- a/libs/ui/tests/kis_recorded_action_editor_test.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * 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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_EDITOR_TEST_H_
-#define _KIS_RECORDED_ACTION_EDITOR_TEST_H_
-
-#include <QObject>
-
-class KisRecordedActionEditorTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void testFilterEditorCreation();
-};
-
-#endif
diff --git a/libs/ui/tool/kis_recording_adapter.cpp b/libs/ui/tool/kis_recording_adapter.cpp
deleted file mode 100644
index 41e67fa9fcb..00000000000
--- a/libs/ui/tool/kis_recording_adapter.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2011 Dmitry Kazakov <dimula73 at gmail.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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "kis_recording_adapter.h"
-
-#include "kis_image.h"
-#include "kis_node.h"
-#include <brushengine/kis_paintop_preset.h>
-
-#include "recorder/kis_action_recorder.h"
-#include "recorder/kis_recorded_path_paint_action.h"
-#include "recorder/kis_node_query_path.h"
-
-
-KisRecordingAdapter::KisRecordingAdapter()
- : m_pathPaintAction(0)
-{
-}
-
-KisRecordingAdapter::~KisRecordingAdapter()
-{
-}
-
-void KisRecordingAdapter::startStroke(KisImageWSP image, KisResourcesSnapshotSP resources,
- const KisDistanceInitInfo &startDistInfo)
-{
- Q_ASSERT(!m_pathPaintAction);
- Q_ASSERT(!m_image);
-
- m_image = image;
- m_pathPaintAction = new KisRecordedPathPaintAction(
- KisNodeQueryPath::absolutePath(resources->currentNode()), 0, startDistInfo);
-
- resources->setupPaintAction(m_pathPaintAction);
-}
-
-void KisRecordingAdapter::endStroke()
-{
- Q_ASSERT(m_pathPaintAction);
- Q_ASSERT(m_image);
-
- m_image->actionRecorder()->addAction(*m_pathPaintAction);
-
- delete m_pathPaintAction;
- m_pathPaintAction = 0;
- m_image = 0;
-}
-
-
-void KisRecordingAdapter::addPoint(const KisPaintInformation &pi)
-{
- KIS_SAFE_ASSERT_RECOVER_RETURN(m_pathPaintAction);
- m_pathPaintAction->addPoint(pi);
-}
-
-void KisRecordingAdapter::addLine(const KisPaintInformation &pi1,
- const KisPaintInformation &pi2)
-{
- KIS_SAFE_ASSERT_RECOVER_RETURN(m_pathPaintAction);
- m_pathPaintAction->addLine(pi1, pi2);
-}
-
-
-void KisRecordingAdapter::addCurve(const KisPaintInformation &pi1,
- const QPointF &control1,
- const QPointF &control2,
- const KisPaintInformation &pi2)
-{
- KIS_SAFE_ASSERT_RECOVER_RETURN(m_pathPaintAction);
- m_pathPaintAction->addCurve(pi1, control1, control2, pi2);
-}
-
diff --git a/libs/ui/tool/kis_recording_adapter.h b/libs/ui/tool/kis_recording_adapter.h
deleted file mode 100644
index 76b8752465a..00000000000
--- a/libs/ui/tool/kis_recording_adapter.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2011 Dmitry Kazakov <dimula73 at gmail.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 of the License, 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef __KIS_RECORDING_ADAPTER_H
-#define __KIS_RECORDING_ADAPTER_H
-
-#include "kis_types.h"
-#include "kis_resources_snapshot.h"
-
-class KisRecordedPathPaintAction;
-class KisPaintInformation;
-class KisDistanceInitInfo;
-
-
-class KisRecordingAdapter
-{
-public:
- KisRecordingAdapter();
- ~KisRecordingAdapter();
-
- void startStroke(KisImageWSP image, KisResourcesSnapshotSP resources,
- const KisDistanceInitInfo &startDist);
- void endStroke();
-
- void addPoint(const KisPaintInformation &pi);
- void addLine(const KisPaintInformation &pi1,
- const KisPaintInformation &pi2);
-
- void addCurve(const KisPaintInformation &pi1,
- const QPointF &control1,
- const QPointF &control2,
- const KisPaintInformation &pi2);
-
-private:
- KisImageWSP m_image;
- KisRecordedPathPaintAction *m_pathPaintAction;
-};
-
-#endif /* __KIS_RECORDING_ADAPTER_H */
diff --git a/libs/ui/tool/kis_resources_snapshot.cpp b/libs/ui/tool/kis_resources_snapshot.cpp
index 733ef420a0f..99384963f94 100644
--- a/libs/ui/tool/kis_resources_snapshot.cpp
+++ b/libs/ui/tool/kis_resources_snapshot.cpp
@@ -31,7 +31,6 @@
#include "kis_image.h"
#include "kis_paint_device.h"
#include "kis_paint_layer.h"
-#include "recorder/kis_recorded_paint_action.h"
#include "kis_selection.h"
#include "kis_selection_mask.h"
#include "kis_algebra_2d.h"
@@ -223,24 +222,6 @@ void KisResourcesSnapshot::setupMaskingBrushPainter(KisPainter *painter)
m_d->currentNode, m_d->image);
}
-void KisResourcesSnapshot::setupPaintAction(KisRecordedPaintAction *action)
-{
- action->setPaintOpPreset(m_d->currentPaintOpPreset);
- action->setPaintIncremental(!needsIndirectPainting());
-
- action->setPaintColor(m_d->currentFgColor);
- action->setBackgroundColor(m_d->currentBgColor);
- action->setGenerator(m_d->currentGenerator);
- action->setGradient(m_d->currentGradient);
- action->setPattern(m_d->currentPattern);
-
- action->setOpacity(m_d->opacity / qreal(OPACITY_OPAQUE_U8));
- action->setCompositeOp(m_d->compositeOp->id());
-
- action->setStrokeStyle(m_d->strokeStyle);
- action->setFillStyle(m_d->fillStyle);
-}
-
KisPostExecutionUndoAdapter* KisResourcesSnapshot::postExecutionUndoAdapter() const
{
return m_d->image ? m_d->image->postExecutionUndoAdapter() : 0;
diff --git a/libs/ui/tool/kis_resources_snapshot.h b/libs/ui/tool/kis_resources_snapshot.h
index 16e280c1695..658936ba89c 100644
--- a/libs/ui/tool/kis_resources_snapshot.h
+++ b/libs/ui/tool/kis_resources_snapshot.h
@@ -30,12 +30,11 @@ class KoCanvasResourceManager;
class KoCompositeOp;
class KisPainter;
class KisPostExecutionUndoAdapter;
-class KisRecordedPaintAction;
class KoPattern;
/**
* @brief The KisResourcesSnapshot class takes a snapshot of the various resources
- * like colors and settings used at the begin of a stroke or a recording so subsequent
+ * like colors and settings used at the begin of a stroke so subsequent
* changes don't impact the running stroke. The main reason for the snapshot is that the
* user can *change* the options while the stroke is being executed in the background.
*/
@@ -49,10 +48,6 @@ public:
void setupPainter(KisPainter *painter);
void setupMaskingBrushPainter(KisPainter *painter);
- // XXX: This was marked as KDE_DEPRECATED, but no althernative was
- // given in the apidox.
- void setupPaintAction(KisRecordedPaintAction *action);
-
KisPostExecutionUndoAdapter* postExecutionUndoAdapter() const;
void setCurrentNode(KisNodeSP node);
void setStrokeStyle(KisPainter::StrokeStyle strokeStyle);
diff --git a/libs/ui/tool/kis_tool.cc b/libs/ui/tool/kis_tool.cc
index 3331b2edb7d..f9ee6ee555e 100644
--- a/libs/ui/tool/kis_tool.cc
+++ b/libs/ui/tool/kis_tool.cc
@@ -62,7 +62,6 @@
#include "kis_config.h"
#include "kis_config_notifier.h"
#include "kis_cursor.h"
-#include <recorder/kis_recorded_paint_action.h>
#include <kis_selection_mask.h>
#include "kis_resources_snapshot.h"
#include <KisView.h>
@@ -548,12 +547,6 @@ void KisTool::deleteSelection()
}
}
-void KisTool::setupPaintAction(KisRecordedPaintAction* action)
-{
- action->setPaintColor(currentFgColor());
- action->setBackgroundColor(currentBgColor());
-}
-
QWidget* KisTool::createOptionWidget()
{
d->optionWidget = new QLabel(i18n("No options"));
diff --git a/libs/ui/tool/kis_tool.h b/libs/ui/tool/kis_tool.h
index 21d532cee48..dcf5368519d 100644
--- a/libs/ui/tool/kis_tool.h
+++ b/libs/ui/tool/kis_tool.h
@@ -43,7 +43,6 @@ class KisFilterConfiguration;
class QPainter;
class QPainterPath;
class QPolygonF;
-class KisRecordedPaintAction;
/// Definitions of the toolgroups of Krita
static const QString TOOL_TYPE_SHAPE = "0 Krita/Shape"; // Geometric shapes like ellipses and lines
@@ -271,8 +270,6 @@ protected:
KisPaintOpPresetSP currentPaintOpPreset();
KisFilterConfigurationSP currentGenerator();
- virtual void setupPaintAction(KisRecordedPaintAction* action);
-
/// paint the path which is in view coordinates, default paint mode is XOR_MODE, BW_MODE is also possible
/// never apply transformations to the painter, they would be useless, if drawing in OpenGL mode. The coordinates in the path should be in view coordinates.
void paintToolOutline(QPainter * painter, const QPainterPath &path);
diff --git a/libs/ui/tool/kis_tool_freehand.cc b/libs/ui/tool/kis_tool_freehand.cc
index f419cc11d0b..3df3db09573 100644
--- a/libs/ui/tool/kis_tool_freehand.cc
+++ b/libs/ui/tool/kis_tool_freehand.cc
@@ -57,7 +57,6 @@
#include <kis_painting_assistants_decoration.h>
#include "kis_painting_information_builder.h"
#include "kis_tool_freehand_helper.h"
-#include "kis_recording_adapter.h"
#include "strokes/freehand_stroke.h"
using namespace std::placeholders; // For _1 placeholder
@@ -76,17 +75,14 @@ KisToolFreehand::KisToolFreehand(KoCanvasBase * canvas, const QCursor & cursor,
setMaskSyntheticEvents(KisConfig().disableTouchOnCanvas()); // Disallow mouse events from finger presses unless enabled
m_infoBuilder = new KisToolFreehandPaintingInformationBuilder(this);
- m_recordingAdapter = new KisRecordingAdapter();
- m_helper = new KisToolFreehandHelper(m_infoBuilder, transactionText, m_recordingAdapter);
+ m_helper = new KisToolFreehandHelper(m_infoBuilder, transactionText);
- connect(m_helper, SIGNAL(requestExplicitUpdateOutline()),
- SLOT(explicitUpdateOutline()));
+ connect(m_helper, SIGNAL(requestExplicitUpdateOutline()), SLOT(explicitUpdateOutline()));
}
KisToolFreehand::~KisToolFreehand()
{
delete m_helper;
- delete m_recordingAdapter;
delete m_infoBuilder;
}
@@ -142,11 +138,6 @@ KisPaintingInformationBuilder* KisToolFreehand::paintingInformationBuilder() con
return m_infoBuilder;
}
-KisRecordingAdapter* KisToolFreehand::recordingAdapter() const
-{
- return m_recordingAdapter;
-}
-
void KisToolFreehand::resetHelper(KisToolFreehandHelper *helper)
{
delete m_helper;
diff --git a/libs/ui/tool/kis_tool_freehand.h b/libs/ui/tool/kis_tool_freehand.h
index 28db6de7cdb..bc090e75ee5 100644
--- a/libs/ui/tool/kis_tool_freehand.h
+++ b/libs/ui/tool/kis_tool_freehand.h
@@ -33,11 +33,8 @@
class KoPointerEvent;
class KoCanvasBase;
-
-
class KisPaintingInformationBuilder;
class KisToolFreehandHelper;
-class KisRecordingAdapter;
class KRITAUI_EXPORT KisToolFreehand : public KisToolPaint
@@ -83,7 +80,6 @@ protected:
KisPaintingInformationBuilder* paintingInformationBuilder() const;
- KisRecordingAdapter* recordingAdapter() const;
void resetHelper(KisToolFreehandHelper *helper);
protected Q_SLOTS:
@@ -120,7 +116,6 @@ protected:
private:
KisPaintingInformationBuilder *m_infoBuilder;
KisToolFreehandHelper *m_helper;
- KisRecordingAdapter *m_recordingAdapter;
QPointF m_initialGestureDocPoint;
QPointF m_lastDocumentPoint;
diff --git a/libs/ui/tool/kis_tool_freehand_helper.cpp b/libs/ui/tool/kis_tool_freehand_helper.cpp
index f060c6cf917..f0c4b994bb8 100644
--- a/libs/ui/tool/kis_tool_freehand_helper.cpp
+++ b/libs/ui/tool/kis_tool_freehand_helper.cpp
@@ -29,7 +29,6 @@
#include "kis_algebra_2d.h"
#include "kis_distance_information.h"
#include "kis_painting_information_builder.h"
-#include "kis_recording_adapter.h"
#include "kis_image.h"
#include "kis_painter.h"
#include <brushengine/kis_paintop_preset.h>
@@ -66,7 +65,6 @@ const qreal TIMING_UPDATE_INTERVAL = 50.0;
struct KisToolFreehandHelper::Private
{
KisPaintingInformationBuilder *infoBuilder;
- KisRecordingAdapter *recordingAdapter;
KisStrokesFacade *strokesFacade;
KUndo2MagicString transactionText;
@@ -122,12 +120,10 @@ struct KisToolFreehandHelper::Private
KisToolFreehandHelper::KisToolFreehandHelper(KisPaintingInformationBuilder *infoBuilder,
const KUndo2MagicString &transactionText,
- KisRecordingAdapter *recordingAdapter,
KisSmoothingOptions *smoothingOptions)
: m_d(new Private())
{
m_d->infoBuilder = infoBuilder;
- m_d->recordingAdapter = recordingAdapter;
m_d->transactionText = transactionText;
m_d->smoothingOptions = KisSmoothingOptionsSP(
smoothingOptions ? smoothingOptions : new KisSmoothingOptions());
@@ -311,10 +307,6 @@ void KisToolFreehandHelper::initPaintImpl(qreal startAngle,
createPainters(m_d->strokeInfos,
startDist);
- if(m_d->recordingAdapter) {
- m_d->recordingAdapter->startStroke(image, m_d->resources, startDistInfo);
- }
-
KisStrokeStrategy *stroke =
new FreehandStrokeStrategy(m_d->resources, m_d->strokeInfos, m_d->transactionText);
@@ -653,10 +645,6 @@ void KisToolFreehandHelper::endPaint()
m_d->strokesFacade->endStroke(m_d->strokeId);
m_d->strokeId.clear();
-
- if(m_d->recordingAdapter) {
- m_d->recordingAdapter->endStroke();
- }
}
void KisToolFreehandHelper::cancelPaint()
@@ -687,10 +675,6 @@ void KisToolFreehandHelper::cancelPaint()
m_d->strokesFacade->cancelStroke(m_d->strokeId);
m_d->strokeId.clear();
- if(m_d->recordingAdapter) {
- //FIXME: not implemented
- //m_d->recordingAdapter->cancelStroke();
- }
}
int KisToolFreehandHelper::elapsedStrokeTime() const
@@ -925,9 +909,6 @@ void KisToolFreehandHelper::paintAt(int strokeInfoId,
m_d->strokesFacade->addJob(m_d->strokeId,
new FreehandStrokeStrategy::Data(strokeInfoId, pi));
- if(m_d->recordingAdapter) {
- m_d->recordingAdapter->addPoint(pi);
- }
}
void KisToolFreehandHelper::paintLine(int strokeInfoId,
@@ -938,9 +919,6 @@ void KisToolFreehandHelper::paintLine(int strokeInfoId,
m_d->strokesFacade->addJob(m_d->strokeId,
new FreehandStrokeStrategy::Data(strokeInfoId, pi1, pi2));
- if(m_d->recordingAdapter) {
- m_d->recordingAdapter->addLine(pi1, pi2);
- }
}
void KisToolFreehandHelper::paintBezierCurve(int strokeInfoId,
@@ -978,9 +956,6 @@ void KisToolFreehandHelper::paintBezierCurve(int strokeInfoId,
new FreehandStrokeStrategy::Data(strokeInfoId,
pi1, control1, control2, pi2));
- if(m_d->recordingAdapter) {
- m_d->recordingAdapter->addCurve(pi1, control1, control2, pi2);
- }
}
void KisToolFreehandHelper::createPainters(QVector<KisFreehandStrokeInfo*> &strokeInfos,
diff --git a/libs/ui/tool/kis_tool_freehand_helper.h b/libs/ui/tool/kis_tool_freehand_helper.h
index 75840a2ee16..d313eca2454 100644
--- a/libs/ui/tool/kis_tool_freehand_helper.h
+++ b/libs/ui/tool/kis_tool_freehand_helper.h
@@ -34,7 +34,6 @@
class KoPointerEvent;
class KoCanvasResourceManager;
class KisPaintingInformationBuilder;
-class KisRecordingAdapter;
class KisStrokesFacade;
class KisPostExecutionUndoAdapter;
class KisPaintOp;
@@ -49,7 +48,6 @@ public:
KisToolFreehandHelper(KisPaintingInformationBuilder *infoBuilder,
const KUndo2MagicString &transactionText = KUndo2MagicString(),
- KisRecordingAdapter *recordingAdapter = 0,
KisSmoothingOptions *smoothingOptions = 0);
~KisToolFreehandHelper() override;
diff --git a/libs/ui/tool/kis_tool_multihand_helper.cpp b/libs/ui/tool/kis_tool_multihand_helper.cpp
index 705c377e319..fe430d0edc0 100644
--- a/libs/ui/tool/kis_tool_multihand_helper.cpp
+++ b/libs/ui/tool/kis_tool_multihand_helper.cpp
@@ -29,9 +29,8 @@ struct KisToolMultihandHelper::Private
};
KisToolMultihandHelper::KisToolMultihandHelper(KisPaintingInformationBuilder *infoBuilder,
- const KUndo2MagicString &transactionText,
- KisRecordingAdapter *recordingAdapter)
- : KisToolFreehandHelper(infoBuilder, transactionText, recordingAdapter)
+ const KUndo2MagicString &transactionText)
+ : KisToolFreehandHelper(infoBuilder, transactionText)
, d(new Private)
{
}
@@ -63,7 +62,7 @@ void KisToolMultihandHelper::paintAt(const KisPaintInformation &pi)
QLineF rotateme(QPointF (0.0,0.0), QPointF (10.0,10.0));
rotateme.setAngle(__pi.canvasRotation());
QLineF rotated = transform.map(rotateme);
-
+
__pi.setPos(transform.map(__pi.pos()));
__pi.setCanvasRotation(rotated.angle());
@@ -86,7 +85,7 @@ void KisToolMultihandHelper::paintLine(const KisPaintInformation &pi1,
KisPaintInformation __pi2 = pi2;
__pi1.setPos(transform.map(__pi1.pos()));
__pi2.setPos(transform.map(__pi2.pos()));
-
+
QLineF rotateme(QPointF (0.0,0.0), QPointF (10.0,10.0));
rotateme.setAngle(__pi1.canvasRotation());
QLineF rotated = transform.map(rotateme);
@@ -99,11 +98,11 @@ void KisToolMultihandHelper::paintLine(const KisPaintInformation &pi1,
//check mirroring
if (__pi2.canvasMirroredH()) {
__pi1.setCanvasRotation(180-__pi1.canvasRotation());
- __pi1.setCanvasRotation(__pi1.canvasRotation()+180);
+ __pi1.setCanvasRotation(__pi1.canvasRotation()+180);
__pi2.setCanvasRotation(180-__pi2.canvasRotation());
__pi2.setCanvasRotation(__pi2.canvasRotation()+180);
}
-
+
paintLine(i, __pi1, __pi2);
}
@@ -121,23 +120,23 @@ void KisToolMultihandHelper::paintBezierCurve(const KisPaintInformation &pi1,
KisPaintInformation __pi2 = pi2;
__pi1.setPos(transform.map(__pi1.pos()));
__pi2.setPos(transform.map(__pi2.pos()));
-
+
QLineF rotateme(QPointF (0.0,0.0), QPointF (10.0,10.0));
rotateme.setAngle(__pi1.canvasRotation());
QLineF rotated = transform.map(rotateme);
__pi1.setCanvasRotation(rotated.angle());
-
+
rotateme.setAngle(__pi2.canvasRotation());
rotated = transform.map(rotateme);
__pi2.setCanvasRotation(rotated.angle());
-
+
if (__pi2.canvasMirroredH()) {
__pi1.setCanvasRotation(180-__pi1.canvasRotation());
- __pi1.setCanvasRotation(__pi1.canvasRotation()+180);
+ __pi1.setCanvasRotation(__pi1.canvasRotation()+180);
__pi2.setCanvasRotation(180-__pi2.canvasRotation());
__pi2.setCanvasRotation(__pi2.canvasRotation()+180);
}
-
+
QPointF __control1 = transform.map(control1);
QPointF __control2 = transform.map(control2);
diff --git a/libs/ui/tool/kis_tool_multihand_helper.h b/libs/ui/tool/kis_tool_multihand_helper.h
index 5530ce58a25..38a31b6e1cb 100644
--- a/libs/ui/tool/kis_tool_multihand_helper.h
+++ b/libs/ui/tool/kis_tool_multihand_helper.h
@@ -28,8 +28,7 @@ class KRITAUI_EXPORT KisToolMultihandHelper : public KisToolFreehandHelper
public:
KisToolMultihandHelper(KisPaintingInformationBuilder *infoBuilder,
- const KUndo2MagicString &transactionText,
- KisRecordingAdapter *recordingAdapter = 0);
+ const KUndo2MagicString &transactionText);
~KisToolMultihandHelper() override;
void setupTransformations(const QVector<QTransform> &transformations);
diff --git a/libs/ui/tool/kis_tool_paint.cc b/libs/ui/tool/kis_tool_paint.cc
index 7b32baba970..83fe524badd 100644
--- a/libs/ui/tool/kis_tool_paint.cc
+++ b/libs/ui/tool/kis_tool_paint.cc
@@ -70,7 +70,6 @@
#include "widgets/kis_cmb_composite.h"
#include "widgets/kis_slider_spin_box.h"
#include "kis_canvas_resource_provider.h"
-#include <recorder/kis_recorded_paint_action.h>
#include "kis_tool_utils.h"
#include <brushengine/kis_paintop.h>
#include <brushengine/kis_paintop_preset.h>
@@ -620,16 +619,6 @@ void KisToolPaint::slotPopupQuickHelp()
QWhatsThis::showText(QCursor::pos(), quickHelp());
}
-void KisToolPaint::setupPaintAction(KisRecordedPaintAction* action)
-{
- KisTool::setupPaintAction(action);
- action->setOpacity(m_opacity / qreal(255.0));
- const KoCompositeOp *op = compositeOp();
- if (op) {
- action->setCompositeOp(op->id());
- }
-}
-
KisToolPaint::NodePaintAbility KisToolPaint::nodePaintAbility()
{
KisNodeSP node = currentNode();
diff --git a/libs/ui/tool/kis_tool_paint.h b/libs/ui/tool/kis_tool_paint.h
index 93d1153d13a..129d7666551 100644
--- a/libs/ui/tool/kis_tool_paint.h
+++ b/libs/ui/tool/kis_tool_paint.h
@@ -110,8 +110,6 @@ protected:
return QString();
}
- void setupPaintAction(KisRecordedPaintAction* action) override;
-
enum NodePaintAbility {
NONE,
PAINT,
diff --git a/libs/ui/tool/kis_tool_shape.cc b/libs/ui/tool/kis_tool_shape.cc
index 9f46b39d2e7..270a060e789 100644
--- a/libs/ui/tool/kis_tool_shape.cc
+++ b/libs/ui/tool/kis_tool_shape.cc
@@ -43,11 +43,8 @@
#include <brushengine/kis_paintop_registry.h>
#include <kis_paint_layer.h>
#include <kis_paint_device.h>
-#include <recorder/kis_recorded_paint_action.h>
-#include <recorder/kis_recorded_path_paint_action.h>
#include "kis_figure_painting_tool_helper.h"
-#include <recorder/kis_node_query_path.h>
-#include <recorder/kis_action_recorder.h>
+#include <kis_node_query_path.h>
#include <KoSelectedShapesProxy.h>
#include <KoSelection.h>
@@ -140,16 +137,6 @@ qreal KisToolShape::currentStrokeWidth() const
return canvas()->unit().fromUserValue(sizeInPx);
}
-void KisToolShape::setupPaintAction(KisRecordedPaintAction* action)
-{
- KisToolPaint::setupPaintAction(action);
- action->setFillStyle(fillStyle());
- action->setStrokeStyle(strokeStyle());
- action->setGenerator(currentGenerator());
- action->setPattern(currentPattern());
- action->setGradient(currentGradient());
-}
-
void KisToolShape::addShape(KoShape* shape)
{
KoImageCollection* imageCollection = canvas()->shapeController()->resourceManager()->imageCollection();
@@ -220,8 +207,6 @@ void KisToolShape::addPathShape(KoPathShape* pathShape, const KUndo2MagicString&
if (!node || !blockUntilOperationsFinished()) {
return;
}
- // Get painting options
- KisPaintOpPresetSP preset = currentPaintOpPreset();
// Compute the outline
KisImageSP image = this->image();
@@ -230,44 +215,6 @@ void KisToolShape::addPathShape(KoPathShape* pathShape, const KUndo2MagicString&
matrix.translate(pathShape->position().x(), pathShape->position().y());
QPainterPath mapedOutline = matrix.map(pathShape->outline());
- // Recorde the paint action
- KisRecordedPathPaintAction bezierCurvePaintAction(
- KisNodeQueryPath::absolutePath(node),
- preset,
- KisDistanceInitInfo());
- bezierCurvePaintAction.setPaintColor(currentFgColor());
- QPointF lastPoint, nextPoint;
- int elementCount = mapedOutline.elementCount();
- for (int i = 0; i < elementCount; i++) {
- QPainterPath::Element element = mapedOutline.elementAt(i);
- switch (element.type) {
- case QPainterPath::MoveToElement:
- if (i != 0) {
- qFatal("Unhandled"); // XXX: I am not sure the tool can produce such element, deal with it when it can
- }
- lastPoint = QPointF(element.x, element.y);
- break;
- case QPainterPath::LineToElement:
- nextPoint = QPointF(element.x, element.y);
- bezierCurvePaintAction.addLine(KisPaintInformation(lastPoint), KisPaintInformation(nextPoint));
- lastPoint = nextPoint;
- break;
- case QPainterPath::CurveToElement:
- nextPoint = QPointF(mapedOutline.elementAt(i + 2).x, mapedOutline.elementAt(i + 2).y);
- bezierCurvePaintAction.addCurve(KisPaintInformation(lastPoint),
- QPointF(mapedOutline.elementAt(i).x,
- mapedOutline.elementAt(i).y),
- QPointF(mapedOutline.elementAt(i + 1).x,
- mapedOutline.elementAt(i + 1).y),
- KisPaintInformation(nextPoint));
- lastPoint = nextPoint;
- break;
- default:
- continue;
- }
- }
- image->actionRecorder()->addAction(bezierCurvePaintAction);
-
if (node->hasEditablePaintDevice()) {
KisFigurePaintingToolHelper helper(name,
image,
diff --git a/libs/ui/tool/kis_tool_shape.h b/libs/ui/tool/kis_tool_shape.h
index fcd913d999c..71aa2222048 100644
--- a/libs/ui/tool/kis_tool_shape.h
+++ b/libs/ui/tool/kis_tool_shape.h
@@ -71,8 +71,6 @@ protected:
qreal currentStrokeWidth() const;
- void setupPaintAction(KisRecordedPaintAction* action) override;
-
void addShape(KoShape* shape);
void addPathShape(KoPathShape* pathShape, const KUndo2MagicString& name);
diff --git a/plugins/extensions/CMakeLists.txt b/plugins/extensions/CMakeLists.txt
index b5ed7be8598..9ace76c315d 100644
--- a/plugins/extensions/CMakeLists.txt
+++ b/plugins/extensions/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_subdirectory( bigbrother )
add_subdirectory( imagesplit )
add_subdirectory( clonesarray )
add_subdirectory( colorrange )
diff --git a/plugins/extensions/bigbrother/CMakeLists.txt b/plugins/extensions/bigbrother/CMakeLists.txt
deleted file mode 100644
index 6510562d103..00000000000
--- a/plugins/extensions/bigbrother/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-set(kritabigbrother_SOURCES
- bigbrother.cc
- actionseditor/kis_actions_editor.cpp
- actionseditor/kis_actions_editor_dialog.cpp
- actionseditor/kis_macro_model.cpp )
-
-ki18n_wrap_ui(kritabigbrother_SOURCES
- actionseditor/wdgactionseditor.ui )
-
-add_library(kritabigbrother MODULE ${kritabigbrother_SOURCES})
-target_link_libraries(kritabigbrother kritaui)
-install(TARGETS kritabigbrother DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
-install( FILES bigbrother.xmlgui DESTINATION ${DATA_INSTALL_DIR}/kritaplugins)
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.cpp b/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.cpp
deleted file mode 100644
index ee37a7df7a6..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "kis_actions_editor.h"
-
-#include "ui_wdgactionseditor.h"
-
-#include "kis_macro_model.h"
-#include <recorder/kis_recorded_action.h>
-#include <recorder/kis_macro.h>
-#include <recorder/kis_recorded_action_editor_factory_registry.h>
-#include <recorder/kis_recorded_action_creator_factory_registry.h>
-#include <recorder/kis_recorded_action_creator_factory.h>
-#include <recorder/kis_recorded_action_creator.h>
-
-#include <KoDialog.h>
-#include <KoIcon.h>
-#include <kis_icon.h>
-
-#include <QMessageBox>
-
-#include <QMenu>
-#include <QSignalMapper>
-
-KisActionsEditor::KisActionsEditor(QWidget* parent) : QWidget(parent), m_currentEditor(0), m_form(new Ui::ActionsEditor), m_macro(0), m_model(0), m_widgetLayout(0)
-
-{
- m_form->setupUi(this);
-
- // Setup buttons
- m_form->bnAdd->setIcon(KisIconUtils::loadIcon("list-add"));
- QSignalMapper* mapper = new QSignalMapper(this);
- connect(mapper, SIGNAL(mapped(QString)), SLOT(slotCreateAction(QString)));
- QMenu* addMenu = new QMenu;
- Q_FOREACH (const KoID& id, KisRecordedActionCreatorFactoryRegistry::instance()->creators())
- {
- QAction* action = addMenu->addAction(id.name(), mapper, SLOT(map()));
- mapper->setMapping(action, id.id());
- }
- m_form->bnAdd->setMenu(addMenu);
-
-
- m_form->bnDelete->setIcon(KisIconUtils::loadIcon("edit-delete"));
- connect(m_form->bnDelete, SIGNAL(released()), SLOT(slotBtnDelete()));
-
- m_form->bnRaise->setIcon(KisIconUtils::loadIcon("arrow-up"));
- connect(m_form->bnRaise, SIGNAL(released()), SLOT(slotBtnRaise()));
-
- m_form->bnLower->setIcon(KisIconUtils::loadIcon("arrow-down"));
- connect(m_form->bnLower, SIGNAL(released()), SLOT(slotBtnLower()));
-
- m_form->bnDuplicate->setIcon(KisIconUtils::loadIcon("edit-copy"));
- connect(m_form->bnDuplicate, SIGNAL(released()), SLOT(slotBtnDuplicate()));
-
- // Setup actions list
- connect(m_form->actionsList, SIGNAL(clicked(const QModelIndex&)), SLOT(slotActionActivated(const QModelIndex&)));
- connect(m_form->actionsList, SIGNAL(activated(QModelIndex)), SLOT(slotActionActivated(const QModelIndex&)));
-
- // Editor
- m_widgetLayout = new QGridLayout(m_form->editorWidget);
- setCurrentAction(0);
-}
-
-KisActionsEditor::~KisActionsEditor()
-{
- delete m_form;
-}
-
-void KisActionsEditor::setMacro(KisMacro* _macro)
-{
- m_macro = _macro;
- KisMacroModel* oldModel = m_model;
- m_model = new KisMacroModel(m_macro);
- m_form->actionsList->setModel(m_model);
- delete oldModel;
-}
-
-void KisActionsEditor::slotCreateAction(const QString& _id)
-{
- KisRecordedActionCreatorFactory* f = KisRecordedActionCreatorFactoryRegistry::instance()->get(_id);
- Q_ASSERT(f);
- if(!f) return;
- KisRecordedAction* action = 0;
- if(f->requireCreator())
- {
- KoDialog d;
- d.setButtons(KoDialog::Ok | KoDialog::Cancel);
- KisRecordedActionCreator* creator = f->createCreator(&d);
- d.setMainWidget(creator);
- if(d.exec() == KoDialog::Accepted)
- {
- action = creator->createAction();
- if(!action) {
- QMessageBox::critical(this, i18nc("@title:window", "Krita"), i18n("Failed to create an action."));
- return;
- }
- }
- else {
- return;
- }
- }
- else {
- action = f->createAction();
- }
- Q_ASSERT(action);
-
- m_model->addAction(m_form->actionsList->currentIndex(), *action);
- delete action;
-}
-
-void KisActionsEditor::slotActionActivated(const QModelIndex& item)
-{
- if (item.isValid() && m_macro) {
- setCurrentAction(m_macro->actions()[item.row()]);
- } else {
- setCurrentAction(0);
- }
-}
-
-void KisActionsEditor::setCurrentAction(KisRecordedAction* _action)
-{
- // First change, the editor
- delete m_currentEditor;
- m_currentEditor = 0;
- if (_action) {
- m_currentEditor = KisRecordedActionEditorFactoryRegistry::instance()->createEditor(this, _action);
- } else {
- m_currentEditor = new QLabel(i18n("No action is selected."), this);
- }
- if (!m_currentEditor) {
- m_currentEditor = new QLabel(i18n("No editor for current action."), this);
- }
- m_widgetLayout->addWidget(m_currentEditor, 0 , 0);
-
- // Then disable/enalbed button
- m_form->bnDuplicate->setEnabled(_action);
- m_form->bnRaise->setEnabled(_action);
- m_form->bnLower->setEnabled(_action);
- m_form->bnDelete->setEnabled(_action);
- if (_action) {
- int pos = m_macro->actions().indexOf(_action);
- if (pos == 0) {
- m_form->bnRaise->setEnabled(false);
- }
- if (pos == m_macro->actions().count() - 1) {
- m_form->bnLower->setEnabled(false);
- }
- }
-}
-
-void KisActionsEditor::slotBtnDelete()
-{
- QModelIndex idx = m_form->actionsList->currentIndex();
- Q_ASSERT(idx.isValid());
- m_model->removeRows(idx.row(), 1);
- setCurrentAction(0);
-}
-
-void KisActionsEditor::slotBtnDuplicate()
-{
- QModelIndex idx = m_form->actionsList->currentIndex();
- Q_ASSERT(idx.isValid());
- m_model->duplicateAction(idx);
-}
-
-void KisActionsEditor::slotBtnRaise()
-{
- QModelIndex idx = m_form->actionsList->currentIndex();
- Q_ASSERT(idx.isValid());
- m_model->raise(idx);
- m_form->actionsList->setCurrentIndex(m_model->index(idx.row() - 1));
- slotActionActivated(m_form->actionsList->currentIndex());
-}
-
-void KisActionsEditor::slotBtnLower()
-{
- QModelIndex idx = m_form->actionsList->currentIndex();
- Q_ASSERT(idx.isValid());
- m_model->lower(idx);
- m_form->actionsList->setCurrentIndex(m_model->index(idx.row() + 1));
- slotActionActivated(m_form->actionsList->currentIndex());
-}
-
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.h b/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.h
deleted file mode 100644
index 8ad167b9be6..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_ACTIONS_EDITOR_H_
-#define _KIS_ACTIONS_EDITOR_H_
-
-#include <QWidget>
-
-class KisMacro;
-class KisMacroModel;
-class KisRecordedAction;
-
-class QModelIndex;
-class QGridLayout;
-
-namespace Ui
-{
-class ActionsEditor;
-}
-
-class KisActionsEditor : public QWidget
-{
- Q_OBJECT
-public:
- KisActionsEditor(QWidget* parent);
- ~KisActionsEditor() override;
- void setMacro(KisMacro*);
-private Q_SLOTS:
- void slotCreateAction(const QString& _id);
- void slotActionActivated(const QModelIndex&);
- void slotBtnDelete();
- void slotBtnDuplicate();
- void slotBtnRaise();
- void slotBtnLower();
-private:
- void setCurrentAction(KisRecordedAction* _action);
-private:
- QWidget* m_currentEditor;
- Ui::ActionsEditor* m_form;
- KisMacro* m_macro;
- KisMacroModel* m_model;
- QGridLayout* m_widgetLayout;
-};
-
-#endif
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.cpp b/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.cpp
deleted file mode 100644
index 561b6fa2378..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "kis_actions_editor_dialog.h"
-#include "kis_actions_editor.h"
-
-#include <klocalizedstring.h>
-
-KisActionsEditorDialog::KisActionsEditorDialog(QWidget* parent) : KoDialog(parent),
- m_actionsEditor(new KisActionsEditor(this))
-{
- setMainWidget(m_actionsEditor);
- setButtons(Cancel | Ok);
- setButtonText(Ok, i18n("Save macro"));
- setButtonText(Cancel, i18n("Discard changes"));
-}
-
-KisActionsEditorDialog::~KisActionsEditorDialog()
-{
-}
-
-KisActionsEditor* KisActionsEditorDialog::actionsEditor()
-{
- return m_actionsEditor;
-}
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.h b/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.h
deleted file mode 100644
index 8ca9a824c2c..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_actions_editor_dialog.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_ACTIONS_EDITOR_DIALOG_H_
-#define _KIS_ACTIONS_EDITOR_DIALOG_H_
-
-#include <KoDialog.h>
-
-class KisActionsEditor;
-
-class KisActionsEditorDialog : public KoDialog
-{
-public:
- KisActionsEditorDialog(QWidget* parent);
- ~KisActionsEditorDialog() override;
- KisActionsEditor* actionsEditor();
-private:
- KisActionsEditor* m_actionsEditor;
-};
-
-#endif
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_macro_model.cpp b/plugins/extensions/bigbrother/actionseditor/kis_macro_model.cpp
deleted file mode 100644
index 01f55bf677e..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_macro_model.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "kis_macro_model.h"
-#include <recorder/kis_macro.h>
-#include <recorder/kis_recorded_action.h>
-
-KisMacroModel::KisMacroModel(KisMacro* _macro) : m_macro(_macro)
-{
-}
-
-KisMacroModel::~KisMacroModel()
-{
-}
-
-int KisMacroModel::rowCount(const QModelIndex & parent) const
-{
- Q_UNUSED(parent);
- return m_macro->actions().count();
-}
-
-QVariant KisMacroModel::data(const QModelIndex & index, int role) const
-{
- if (index.isValid()) {
- if (role == Qt::DisplayRole || role == Qt::EditRole) {
- return m_macro->actions()[index.row()]->name();
- }
- }
- return QVariant();
-}
-
-bool KisMacroModel::setData(const QModelIndex & index, const QVariant & value, int role)
-{
- if (index.isValid()) {
- if (role == Qt::EditRole) {
- m_macro->actions()[index.row()]->setName(value.toString());
- return true;
- }
- }
- return false;
-}
-
-Qt::ItemFlags KisMacroModel::flags(const QModelIndex & index) const
-{
- Q_UNUSED(index);
- return Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable;
-}
-
-bool KisMacroModel::removeRows(int row, int count, const QModelIndex & parent)
-{
- beginRemoveRows(parent, row, row + count);
-
- QList<KisRecordedAction*> actions;
- for (int i = row; i < row + count; ++i) {
- actions.push_back(m_macro->actions()[i]);
- }
- m_macro->removeActions(actions);
-
- endRemoveRows();
- return true;
-}
-
-void KisMacroModel::addAction(const QModelIndex& _after, const KisRecordedAction& _action)
-{
- if(m_macro->actions().isEmpty())
- {
- beginInsertRows(QModelIndex(), 0, 0);
- m_macro->addAction(_action);
- endInsertRows();
- } else {
- int row = _after.row();
- beginInsertRows(QModelIndex(), row, row);
- m_macro->addAction(_action, m_macro->actions().at(row));
- endInsertRows();
- }
-}
-
-void KisMacroModel::duplicateAction(const QModelIndex& index)
-{
- if (index.isValid()) {
- KisRecordedAction* action = m_macro->actions()[index.row()];
- beginInsertRows(QModelIndex(), index.row(), index.row());
- m_macro->addAction(*action, action);
- endInsertRows();
- }
-}
-
-void KisMacroModel::raise(const QModelIndex& index)
-{
- if (index.isValid()) {
- KisRecordedAction* action = m_macro->actions()[index.row()];
- KisRecordedAction* before = m_macro->actions()[index.row() - 1];
- m_macro->moveAction(action, before);
- emit(dataChanged(createIndex(index.row() - 1, 0), index));
- }
-}
-
-void KisMacroModel::lower(const QModelIndex& index)
-{
- if (index.isValid()) {
- KisRecordedAction* before = m_macro->actions()[index.row()];
- KisRecordedAction* action = m_macro->actions()[index.row() + 1];
- m_macro->moveAction(action, before);
- emit(dataChanged(index, createIndex(index.row() + 1, 0)));
- }
-}
diff --git a/plugins/extensions/bigbrother/actionseditor/kis_macro_model.h b/plugins/extensions/bigbrother/actionseditor/kis_macro_model.h
deleted file mode 100644
index 8cd9189f8c2..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/kis_macro_model.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _KIS_MACRO_MODEL_H_
-#define _KIS_MACRO_MODEL_H_
-
-#include <QAbstractListModel>
-
-class KisRecordedAction;
-class KisMacro;
-
-class KisMacroModel : public QAbstractListModel
-{
-public:
- KisMacroModel(KisMacro*);
- ~KisMacroModel() override;
- int rowCount(const QModelIndex & parent = QModelIndex()) const override;
- QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
- Qt::ItemFlags flags(const QModelIndex & index) const override;
- bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override;
- bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex()) override;
- void addAction(const QModelIndex& _after, const KisRecordedAction& _action);
- void duplicateAction(const QModelIndex& index);
- void raise(const QModelIndex& index);
- void lower(const QModelIndex& index);
-private:
- KisMacro* m_macro;
-};
-
-
-#endif
diff --git a/plugins/extensions/bigbrother/actionseditor/wdgactionseditor.ui b/plugins/extensions/bigbrother/actionseditor/wdgactionseditor.ui
deleted file mode 100644
index f59e0506341..00000000000
--- a/plugins/extensions/bigbrother/actionseditor/wdgactionseditor.ui
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ActionsEditor</class>
- <widget class="QWidget" name="ActionsEditor">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>682</width>
- <height>403</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QWidget" name="layoutWidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Actions:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QListView" name="actionsList"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QToolButton" name="bnAdd">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>32</width>
- <height>22</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Create a new action</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="popupMode">
- <enum>QToolButton::MenuButtonPopup</enum>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="bnDuplicate">
- <property name="minimumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Duplicate action</string>
- </property>
- <property name="statusTip">
- <string>Duplicate action</string>
- </property>
- <property name="whatsThis">
- <string>Duplicate the currently selected action</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="bnRaise">
- <property name="minimumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Move an action up</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="bnLower">
- <property name="minimumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Move an action down</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="bnDelete">
- <property name="minimumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Delete the current action</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="autoRaise">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="editorWidget"/>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/plugins/extensions/bigbrother/bigbrother.cc b/plugins/extensions/bigbrother/bigbrother.cc
deleted file mode 100644
index aeaac1beac0..00000000000
--- a/plugins/extensions/bigbrother/bigbrother.cc
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger (cberger at cberger.net)
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2.1 of the License.
- *
- * This library 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "bigbrother.h"
-#include <cstdlib>
-#include <unistd.h>
-
-#include <kis_action.h>
-
-#include <kpluginfactory.h>
-#include <klocalizedstring.h>
-
-#include <KoIcon.h>
-#include <kis_icon.h>
-#include <KoUpdater.h>
-#include <KoResourceServerProvider.h>
-#include <KoFileDialog.h>
-#include <KoProgressUpdater.h>
-
-#include <kis_config.h>
-#include <kis_cursor.h>
-#include <kis_debug.h>
-#include <kis_global.h>
-#include <kis_image.h>
-#include <KisResourceServerProvider.h>
-#include <kis_types.h>
-#include <KisViewManager.h>
-#include <resources/KoPattern.h>
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_macro.h>
-#include <recorder/kis_macro_player.h>
-#include <recorder/kis_play_info.h>
-#include <recorder/kis_recorded_action_factory_registry.h>
-#include <recorder/kis_recorded_action.h>
-#include <recorder/kis_recorded_action_load_context.h>
-#include <recorder/kis_recorded_action_save_context.h>
-
-#include "actionseditor/kis_actions_editor.h"
-#include "actionseditor/kis_actions_editor_dialog.h"
-
-#include <QStandardPaths>
-#include <QApplication>
-
-
-K_PLUGIN_FACTORY_WITH_JSON(BigBrotherPluginFactory, "kritabigbrother.json", registerPlugin<BigBrotherPlugin>();)
-
-class RecordedActionSaveContext : public KisRecordedActionSaveContext {
- public:
- void saveGradient(const KoAbstractGradient* ) override {}
- void savePattern(const KoPattern* ) override {}
-};
-
-class RecordedActionLoadContext : public KisRecordedActionLoadContext {
- public:
- KoAbstractGradient* gradient(const QString& name) const override
- {
- return KoResourceServerProvider::instance()->gradientServer()->resourceByName(name);
- }
- KoPattern* pattern(const QString& name) const override
- {
- return KoResourceServerProvider::instance()->patternServer()->resourceByName(name);
- }
-};
-
-BigBrotherPlugin::BigBrotherPlugin(QObject *parent, const QVariantList &)
- : KisActionPlugin(parent)
- , m_recorder(0)
-{
- if (parent->inherits("KisViewManager")) {
- // Open and play action
- KisAction* action = createAction("Macro_Open_Play");
- connect(action, SIGNAL(triggered()), this, SLOT(slotOpenPlay()));
-
- // Open and edit action
- action = createAction("Macro_Open_Edit");
- connect(action, SIGNAL(triggered()), this, SLOT(slotOpenEdit()));
-
- // Start recording action
- m_startRecordingMacroAction = createAction("Recording_Start_Recording_Macro");
- connect(m_startRecordingMacroAction, SIGNAL(triggered()), this, SLOT(slotStartRecordingMacro()));
-
- // Save recorded action
- m_stopRecordingMacroAction = createAction("Recording_Stop_Recording_Macro");
- connect(m_stopRecordingMacroAction, SIGNAL(triggered()), this, SLOT(slotStopRecordingMacro()));
- m_stopRecordingMacroAction->setEnabled(false);
- }
-}
-
-BigBrotherPlugin::~BigBrotherPlugin()
-{
- delete m_recorder;
-}
-
-void BigBrotherPlugin::slotOpenPlay()
-{
- KisMacro* m = openMacro();
- dbgKrita << m;
- if (!m) return;
- dbgPlugins << "Play the macro";
- KoUpdaterPtr updater = viewManager()->createUnthreadedUpdater(i18n("Playing back macro"));
- KisMacroPlayer player(m, KisPlayInfo(viewManager()->image(), viewManager()->activeNode()), updater);
- player.start();
- while(player.isRunning())
- {
- QApplication::processEvents();
- }
- dbgPlugins << "Finished";
- delete m;
-}
-
-
-void BigBrotherPlugin::slotOpenEdit()
-{
- KisMacro *macro = openMacro();
- if (!macro) return;
- KisActionsEditorDialog aed(viewManager()->mainWindow());
-
- aed.actionsEditor()->setMacro(macro);
-
- if (aed.exec() == QDialog::Accepted) {
- saveMacro(macro);
- }
-
- delete macro;
-}
-
-void BigBrotherPlugin::slotStartRecordingMacro()
-{
- dbgPlugins << "Start recording macro";
- if (m_recorder) return;
- // Alternate actions
- m_startRecordingMacroAction->setEnabled(false);
- m_stopRecordingMacroAction->setEnabled(true);
-
- // Create recorder
- m_recorder = new KisMacro();
- connect(viewManager()->image()->actionRecorder(), SIGNAL(addedAction(const KisRecordedAction&)),
- m_recorder, SLOT(addAction(const KisRecordedAction&)));
-}
-
-void BigBrotherPlugin::slotStopRecordingMacro()
-{
- dbgPlugins << "Stop recording macro";
- if (!m_recorder) return;
- // Alternate actions
- m_startRecordingMacroAction->setEnabled(true);
- m_stopRecordingMacroAction->setEnabled(false);
- // Save the macro
- saveMacro(m_recorder);
- // Delete recorder
- delete m_recorder;
- m_recorder = 0;
-}
-
-KisMacro* BigBrotherPlugin::openMacro()
-{
- QStringList mimeFilter;
- mimeFilter << "*.krarec|Recorded actions (*.krarec)";
-
- KoFileDialog dialog(viewManager()->mainWindow(), KoFileDialog::OpenFile, "OpenDocument");
- dialog.setCaption(i18n("Open Macro"));
- dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
- dialog.setMimeTypeFilters(QStringList() << "application/x-krita-recorded-macro");
- QString filename = dialog.filename();
- RecordedActionLoadContext loadContext;
-
- if (!filename.isNull()) {
- QDomDocument doc;
- QFile f(filename);
- if (f.exists()) {
- dbgPlugins << f.open(QIODevice::ReadOnly);
- QString err;
- int line, col;
- if (!doc.setContent(&f, &err, &line, &col)) {
- // TODO error message
- dbgPlugins << err << " line = " << line << " col = " << col;
- f.close();
- return 0;
- }
- f.close();
- QDomElement docElem = doc.documentElement();
- if (!docElem.isNull() && docElem.tagName() == "RecordedActions") {
- dbgPlugins << "Load the macro";
- KisMacro* m = new KisMacro();
- m->fromXML(docElem, &loadContext);
- return m;
- } else {
- // TODO error message
- }
- } else {
- dbgPlugins << "Unexistant file : " << filename;
- }
- }
- return 0;
-}
-
-void BigBrotherPlugin::saveMacro(const KisMacro* macro)
-{
- KoFileDialog dialog(viewManager()->mainWindow(), KoFileDialog::SaveFile, "bigbrother");
- dialog.setCaption(i18n("Save Macro"));
- dialog.setMimeTypeFilters(QStringList() << "application/x-krita-recorded-macro");
-
- QString filename = dialog.filename();
-
- if (!filename.isNull()) {
- QDomDocument doc;
- QDomElement e = doc.createElement("RecordedActions");
- RecordedActionSaveContext context;
- macro->toXML(doc, e, &context);
-
- doc.appendChild(e);
- QFile f(filename);
- f.open(QIODevice::WriteOnly);
- QTextStream stream(&f);
- stream.setCodec("UTF-8");
- doc.save(stream, 2);
- f.close();
- }
-}
-
-#include "bigbrother.moc"
diff --git a/plugins/extensions/bigbrother/bigbrother.h b/plugins/extensions/bigbrother/bigbrother.h
deleted file mode 100644
index c53b4c2fb4b..00000000000
--- a/plugins/extensions/bigbrother/bigbrother.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007 Cyrille Berger (cberger at cberger.net)
- *
- * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2.1 of the License.
- *
- * This library 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _BIGBROTHER_H_
-#define _BIGBROTHER_H_
-
-#include <QVariant>
-#include <KisActionPlugin.h>
-
-class KisAction;
-class KisMacro;
-class KisViewManager;
-
-class BigBrotherPlugin : public KisActionPlugin
-{
- Q_OBJECT
-public:
- BigBrotherPlugin(QObject *parent, const QVariantList &);
- ~BigBrotherPlugin() override;
-
-private Q_SLOTS:
-
- void slotOpenPlay();
- void slotOpenEdit();
- void slotStartRecordingMacro();
- void slotStopRecordingMacro();
-
-private:
- void saveMacro(const KisMacro* macro);
- KisMacro *openMacro();
-private:
- KisMacro *m_recorder;
- KisAction *m_startRecordingMacroAction;
- KisAction *m_stopRecordingMacroAction;
-
-};
-
-#endif // bigbrotherPlugin_H
diff --git a/plugins/extensions/bigbrother/bigbrother.xmlgui b/plugins/extensions/bigbrother/bigbrother.xmlgui
deleted file mode 100644
index 8ed27965c36..00000000000
--- a/plugins/extensions/bigbrother/bigbrother.xmlgui
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui library="kritabigbrother" version="3" translationDomain="krita">
-<MenuBar>
- <Menu name="tools"><text>&Tools</text>
- <Menu name="Recording"><text>Recording</text>
- <Action name="Recording_Start_Recording_Macro"/>
- <Action name="Recording_Stop_Recording_Macro"/>
- </Menu>
- <Menu name="Macros"><text>Macros</text>
- <Action name="Macro_Open_Play" />
- <Action name="Macro_Open_Edit" />
- </Menu>
- </Menu>
-</MenuBar>
-</kpartgui>
diff --git a/plugins/extensions/bigbrother/kritabigbrother.json b/plugins/extensions/bigbrother/kritabigbrother.json
deleted file mode 100644
index 1ac545995cd..00000000000
--- a/plugins/extensions/bigbrother/kritabigbrother.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-
- "Id": "bigbrother",
- "Type": "Service",
- "X-KDE-Library": "kritabigbrother",
- "X-KDE-ServiceTypes": [
- "Krita/ViewPlugin"
- ],
- "X-Krita-Version": "28"
-}
diff --git a/plugins/tools/basictools/kis_tool_ellipse.cc b/plugins/tools/basictools/kis_tool_ellipse.cc
index f06a8d4bbec..926b61fce7c 100644
--- a/plugins/tools/basictools/kis_tool_ellipse.cc
+++ b/plugins/tools/basictools/kis_tool_ellipse.cc
@@ -31,11 +31,6 @@
#include "kis_figure_painting_tool_helper.h"
#include <brushengine/kis_paintop_preset.h>
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_recorded_shape_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-
-
KisToolEllipse::KisToolEllipse(KoCanvasBase * canvas)
: KisToolEllipseBase(canvas, KisToolEllipseBase::PAINT, KisCursor::load("tool_ellipse_cursor.png", 6, 6))
{
@@ -59,12 +54,6 @@ void KisToolEllipse::finishRect(const QRectF& rect)
if (rect.isEmpty() || !blockUntilOperationsFinished())
return;
- if (image()) {
- KisRecordedShapePaintAction linePaintAction(KisNodeQueryPath::absolutePath(currentNode()), currentPaintOpPreset(), KisRecordedShapePaintAction::Ellipse, rect);
- setupPaintAction(&linePaintAction);
- image()->actionRecorder()->addAction(linePaintAction);
- }
-
if (!currentNode()->inherits("KisShapeLayer")) {
KisFigurePaintingToolHelper helper(kundo2_i18n("Draw Ellipse"),
image(),
diff --git a/plugins/tools/basictools/kis_tool_fill.cc b/plugins/tools/basictools/kis_tool_fill.cc
index 4f5a155b90c..35d23d27aa4 100644
--- a/plugins/tools/basictools/kis_tool_fill.cc
+++ b/plugins/tools/basictools/kis_tool_fill.cc
@@ -49,9 +49,6 @@
#include <widgets/kis_cmb_composite.h>
#include <widgets/kis_slider_spin_box.h>
#include <kis_cursor.h>
-#include <recorder/kis_recorded_fill_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-#include <recorder/kis_action_recorder.h>
#include "kis_resources_snapshot.h"
#include <processing/fill_processing_visitor.h>
@@ -127,23 +124,6 @@ void KisToolFill::endPrimaryAction(KoPointerEvent *event)
return;
}
- // TODO: remove this block after recording refactoring
- if (image()) {
- KisNodeSP projectionNode;
- if(m_unmerged) {
- projectionNode = currentNode();
- } else {
- projectionNode = image()->root();
- }
- KisRecordedFillPaintAction paintAction(KisNodeQueryPath::absolutePath(currentNode()), m_startPos, KisNodeQueryPath::absolutePath(projectionNode));
- setupPaintAction(&paintAction);
- paintAction.setPattern(currentPattern());
- if(m_usePattern) {
- paintAction.setFillStyle(KisPainter::FillStylePattern);
- }
- image()->actionRecorder()->addAction(paintAction);
- }
-
bool useFastMode = m_useFastMode->isChecked();
KisProcessingApplicator applicator(currentImage(), currentNode(),
diff --git a/plugins/tools/basictools/kis_tool_line.cc b/plugins/tools/basictools/kis_tool_line.cc
index 358efd9451c..91d87d23e61 100644
--- a/plugins/tools/basictools/kis_tool_line.cc
+++ b/plugins/tools/basictools/kis_tool_line.cc
@@ -41,16 +41,9 @@
#include "kis_figure_painting_tool_helper.h"
#include "kis_canvas2.h"
-
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_recorded_path_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-
#include "kis_painting_information_builder.h"
#include "kis_tool_line_helper.h"
-#define ENABLE_RECORDING
-
const KisCoordinatesConverter* getCoordinatesConverter(KoCanvasBase * canvas)
{
KisCanvas2 *kritaCanvas = dynamic_cast<KisCanvas2*>(canvas);
@@ -237,7 +230,7 @@ void KisToolLine::continuePrimaryAction(KoPointerEvent *event)
if (m_chkShowPreview->isChecked()) {
// If the cursor has moved a significant amount, immediately clear the
// current preview and redraw. Otherwise, do slow redraws periodically.
- auto updateDistance = (pixelToView(m_lastUpdatedPoint) - pixelToView(pos)).manhattanLength();
+ auto updateDistance = (pixelToView(m_lastUpdatedPoint) - pixelToView(pos)).manhattanLength();
if (updateDistance > 10) {
m_helper->clearPaint();
m_longStrokeUpdateCompressor.stop();
diff --git a/plugins/tools/basictools/kis_tool_line_helper.cpp b/plugins/tools/basictools/kis_tool_line_helper.cpp
index 195a8595ae1..230b358999f 100644
--- a/plugins/tools/basictools/kis_tool_line_helper.cpp
+++ b/plugins/tools/basictools/kis_tool_line_helper.cpp
@@ -38,11 +38,9 @@ struct KisToolLineHelper::Private
};
KisToolLineHelper::KisToolLineHelper(KisPaintingInformationBuilder *infoBuilder,
- const KUndo2MagicString &transactionText,
- KisRecordingAdapter *recordingAdapter)
+ const KUndo2MagicString &transactionText)
: KisToolFreehandHelper(infoBuilder,
transactionText,
- recordingAdapter,
new KisSmoothingOptions(false)),
m_d(new Private(infoBuilder))
{
diff --git a/plugins/tools/basictools/kis_tool_line_helper.h b/plugins/tools/basictools/kis_tool_line_helper.h
index 4fbb62913dc..a8f15e15161 100644
--- a/plugins/tools/basictools/kis_tool_line_helper.h
+++ b/plugins/tools/basictools/kis_tool_line_helper.h
@@ -26,8 +26,7 @@ class KisToolLineHelper : private KisToolFreehandHelper
{
public:
KisToolLineHelper(KisPaintingInformationBuilder *infoBuilder,
- const KUndo2MagicString &transactionText,
- KisRecordingAdapter *recordingAdapter = 0);
+ const KUndo2MagicString &transactionText);
~KisToolLineHelper() override;
diff --git a/plugins/tools/basictools/kis_tool_multihand.cpp b/plugins/tools/basictools/kis_tool_multihand.cpp
index 8da94a46f33..bfc025155f6 100644
--- a/plugins/tools/basictools/kis_tool_multihand.cpp
+++ b/plugins/tools/basictools/kis_tool_multihand.cpp
@@ -60,8 +60,7 @@ KisToolMultihand::KisToolMultihand(KoCanvasBase *canvas)
m_helper =
new KisToolMultihandHelper(paintingInformationBuilder(),
- kundo2_i18n("Multibrush Stroke"),
- recordingAdapter());
+ kundo2_i18n("Multibrush Stroke"));
resetHelper(m_helper);
if (image()) {
m_axesPoint = QPointF(0.5 * image()->width(), 0.5 * image()->height());
diff --git a/plugins/tools/basictools/kis_tool_rectangle.cc b/plugins/tools/basictools/kis_tool_rectangle.cc
index 52be92cb970..72d8e5c1bc7 100644
--- a/plugins/tools/basictools/kis_tool_rectangle.cc
+++ b/plugins/tools/basictools/kis_tool_rectangle.cc
@@ -31,10 +31,6 @@
#include "kis_shape_tool_helper.h"
#include "kis_figure_painting_tool_helper.h"
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_recorded_shape_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-
#include <KoCanvasController.h>
#include <KoShapeStroke.h>
@@ -62,12 +58,6 @@ void KisToolRectangle::finishRect(const QRectF &rect)
if (rect.isNull() || !blockUntilOperationsFinished())
return;
- if (image()) {
- KisRecordedShapePaintAction linePaintAction(KisNodeQueryPath::absolutePath(currentNode()), currentPaintOpPreset(), KisRecordedShapePaintAction::Rectangle, rect);
- setupPaintAction(&linePaintAction);
- image()->actionRecorder()->addAction(linePaintAction);
- }
-
if (!currentNode()->inherits("KisShapeLayer")) {
KisFigurePaintingToolHelper helper(kundo2_i18n("Draw Rectangle"),
image(),
diff --git a/plugins/tools/tool_polygon/kis_tool_polygon.cc b/plugins/tools/tool_polygon/kis_tool_polygon.cc
index 3ba7af25bcd..cbd7fe17afa 100644
--- a/plugins/tools/tool_polygon/kis_tool_polygon.cc
+++ b/plugins/tools/tool_polygon/kis_tool_polygon.cc
@@ -31,12 +31,6 @@
#include <brushengine/kis_paintop_registry.h>
#include "kis_figure_painting_tool_helper.h"
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_recorded_path_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-
-
-
KisToolPolygon::KisToolPolygon(KoCanvasBase *canvas)
: KisToolPolylineBase(canvas, KisToolPolylineBase::PAINT, KisCursor::load("tool_polygon_cursor.png", 6, 6))
{
@@ -58,15 +52,6 @@ void KisToolPolygon::finishPolyline(const QVector<QPointF>& points)
{
if (!blockUntilOperationsFinished()) return;
- if (image()) {
- KisRecordedPathPaintAction linePaintAction(KisNodeQueryPath::absolutePath(currentNode()),
- currentPaintOpPreset(),
- KisDistanceInitInfo());
- setupPaintAction(&linePaintAction);
- linePaintAction.addPolyLine(points.toList());
- linePaintAction.addLine(KisPaintInformation(points.last()), KisPaintInformation(points.first()));
- image()->actionRecorder()->addAction(linePaintAction);
- }
if (!currentNode()->inherits("KisShapeLayer")) {
KisFigurePaintingToolHelper helper(kundo2_i18n("Draw Polygon"),
image(),
diff --git a/plugins/tools/tool_polyline/kis_tool_polyline.cc b/plugins/tools/tool_polyline/kis_tool_polyline.cc
index 5ceb6343387..6148d448e6f 100644
--- a/plugins/tools/tool_polyline/kis_tool_polyline.cc
+++ b/plugins/tools/tool_polyline/kis_tool_polyline.cc
@@ -30,12 +30,6 @@
#include <brushengine/kis_paintop_preset.h>
#include "kis_figure_painting_tool_helper.h"
-#include <recorder/kis_action_recorder.h>
-#include <recorder/kis_recorded_path_paint_action.h>
-#include <recorder/kis_node_query_path.h>
-
-
-
KisToolPolyline::KisToolPolyline(KoCanvasBase * canvas)
: KisToolPolylineBase(canvas, KisToolPolylineBase::PAINT, KisCursor::load("tool_polyline_cursor.png", 6, 6))
{
@@ -62,14 +56,6 @@ void KisToolPolyline::finishPolyline(const QVector<QPointF>& points)
{
if (!blockUntilOperationsFinished()) return;
- if (image()) {
- KisRecordedPathPaintAction linePaintAction(KisNodeQueryPath::absolutePath(currentNode()),
- currentPaintOpPreset(),
- KisDistanceInitInfo());
- setupPaintAction(&linePaintAction);
- linePaintAction.addPolyLine(points.toList());
- image()->actionRecorder()->addAction(linePaintAction);
- }
if (!currentNode()->inherits("KisShapeLayer")) {
KisFigurePaintingToolHelper helper(kundo2_i18n("Draw Polyline"),
image(),
More information about the kimageshop
mailing list