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@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.c=
pp
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_registr=
y.cc
D +0 -55 libs/ui/recorder/kis_recorded_action_creator_factory_registr=
y.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_edit=
or.cpp
D +0 -61 plugins/extensions/bigbrother/actionseditor/kis_actions_edit=
or.h
D +0 -41 plugins/extensions/bigbrother/actionseditor/kis_actions_edit=
or_dialog.cpp
D +0 -37 plugins/extensions/bigbrother/actionseditor/kis_actions_edit=
or_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=3D"http://www.kde.org/standards/kxm=
lgui/1.0 http://www.kde.org
Setti&ngs
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 @@
=
-
- Tools
-
- media-record
- &Start recording macro
-
- Start recording macro
- Start recording macro
- 1000
- 0
-
- false
-
-
-
- media-playback-stop
- Stop &recording macro
-
- Stop recording macro
- Stop recording macro
- 1000
- 0
-
- false
-
-
-
- media-playback-start
- &Open and play...
-
- Open and play
- Open and play
- 0
- 0
-
- false
-
-
-
- document-edit
- Open &and edit...
-
- Open and edit
- Open and edit
- 0
- 0
-
- false
-
-
-
-
Settings
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
$
$
$
- $
)
=
set_target_properties(kritaimage PROPERTIES
diff --git a/libs/image/brushengine/kis_paintop_settings.h b/libs/image/bru=
shengine/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 =3D "PaintOpSettings/up=
dateSpacingBetweenDabs";
* 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
#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_no=
de_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_nod=
e_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/record=
er/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
- *
- * 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-13=
01, 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 K=
isRecordedAction* before)
-{
- Q_UNUSED(before);
- emit(addedAction(action));
-}
-
diff --git a/libs/image/recorder/kis_action_recorder.h b/libs/image/recorde=
r/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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_ACTION_RECORDER_H_
-#define _KIS_ACTION_RECORDER_H_
-
-#include
-#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 =3D 0);
- ~KisActionRecorder() override;
-
-public Q_SLOTS:
-
- void addAction(const KisRecordedAction& action, const KisRecordedActio=
n* before =3D 0);
-
-Q_SIGNALS:
- /**
- * This signal is emitted each time an action is added to this recorde=
r.
- */
- void addedAction(const KisRecordedAction& action);
-};
-
-#endif
diff --git a/libs/image/recorder/kis_macro.cc b/libs/image/recorder/kis_mac=
ro.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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_macro.h"
-#include
-
-#include
-#include
-
-#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
-
-struct Q_DECL_HIDDEN KisMacro::Private {
- QList actions;
-};
-
-KisMacro::KisMacro(QObject* parent) : QObject(parent), d(new Private)
-{
-}
-
-KisMacro::KisMacro(const QList& actions) : d(new Priva=
te)
-{
- appendActions(actions);
-}
-
-KisMacro::~KisMacro()
-{
- qDeleteAll(d->actions);
- delete d;
-}
-
-
-void KisMacro::appendActions(const QList& actions)
-{
- Q_FOREACH (KisRecordedAction* action, actions) {
- addAction(*action);
- }
-}
-
-void KisMacro::removeActions(const QList& actions)
-{
- Q_FOREACH (KisRecordedAction* action, actions) {
- d->actions.removeAll(action);
- }
- qDeleteAll(actions);
-}
-
-void KisMacro::addAction(const KisRecordedAction& action, const KisRecorde=
dAction* before)
-{
- if (before =3D=3D 0) {
- KisRecordedAction* a =3D action.clone();
- Q_ASSERT(a);
- d->actions.append(a);
- } else {
- d->actions.insert(d->actions.indexOf(const_cast(before)), action.clone());
- }
-}
-
-void KisMacro::moveAction(const KisRecordedAction* action, const KisRecord=
edAction* before)
-{
- KisRecordedAction* _action =3D d->actions.takeAt(d->actions.indexOf(co=
nst_cast(action)));
- if (before =3D=3D 0) {
- Q_ASSERT(_action);
- d->actions.append(_action);
- } else {
- d->actions.insert(d->actions.indexOf(const_cast(before)), _action);
- }
-}
-
-void KisMacro::fromXML(const QDomElement& docElem, const KisRecordedAction=
LoadContext* loadContext)
-{
- d->actions.clear();
- QDomNode node =3D docElem.firstChild();
- while (!node.isNull()) {
- QDomElement elt =3D node.toElement(); // try to convert the node t=
o an element.
- if (!elt.isNull() && elt.tagName() =3D=3D "RecordedAction") {
- QString id =3D elt.attribute("id", "");
- if (!id.isNull()) {
- dbgImage << "Reconstruct : " << id << endl; // the node re=
ally is an element.
- KisRecordedActionFactory* raf =3D KisRecordedActionFactory=
Registry::instance()->get(id);
- if (raf) {
- KisRecordedAction* a =3D 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.tagNam=
e() =3D=3D "RecordedAction");
- }
- node =3D node.nextSibling();
- }
-}
-
-void KisMacro::toXML(QDomDocument& doc, QDomElement& e, KisRecordedActionS=
aveContext* saveContext) const
-{
- for (QList::iterator it =3D d->actions.begin();
- it !=3D d->actions.end(); ++it) {
- QDomElement eAct =3D doc.createElement("RecordedAction");
- (*it)->toXML(doc, eAct, saveContext);
- e.appendChild(eAct);
- }
-}
-
-const QList& KisMacro::actions() const
-{
- return d->actions;
-}
-
diff --git a/libs/image/recorder/kis_macro.h b/libs/image/recorder/kis_macr=
o.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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_MACRO_H_
-#define _KIS_MACRO_H_
-
-#include
-#include
-#include
-
-#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 rec=
orded action,KisRecordedAction
- * that can be stored as XML, played, and edited.
- */
-class KRITAIMAGE_EXPORT KisMacro : public QObject
-{
- Q_OBJECT
-public:
- KisMacro(QObject* parent =3D 0);
- KisMacro(const QList& _actions);
- ~KisMacro() override;
-public:
- /**
- * Append a list of actions, and make clone of them.
- */
- void appendActions(const QList& actions);
- /**
- * Remove the list of actions. Actions are deleted.
- */
- void removeActions(const QList& 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 KisRecordedActi=
on* before);
-public: // serialization functions
-
- virtual void fromXML(const QDomElement&, const KisRecordedActionLoadCo=
ntext* loadContext);
- virtual void toXML(QDomDocument& doc, QDomElement& e, KisRecordedActio=
nSaveContext* saveContext) const;
- const QList& 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 act=
ion,
- * otherwise, if null, the action will be added at the e=
nd.
- */
- virtual void addAction(const KisRecordedAction& action, const KisRecor=
dedAction* before =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_macro_player.h"
-
-#include
-
-#include
-#include
-
-#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(i=
nfo))
-{
- d->macro =3D _macro;
- d->updater =3D updater;
-}
-
-KisMacroPlayer::~KisMacroPlayer()
-{
- delete d;
-}
-
-void KisMacroPlayer::pause()
-{
- d->paused =3D true;
-}
-
-void KisMacroPlayer::resume()
-{
- d->paused =3D false;
-}
-
-void KisMacroPlayer::run()
-{
- d->paused =3D false;
- QList actions =3D 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 =3D 0;
- if(d->updater) {
- progressUpdater =3D new KoProgressUpdater(d->updater);
- progressUpdater->start(actions.size(), i18n("Playing back macro"));
- }
-
- for (QList::iterator it =3D actions.begin(); it !=
=3D actions.end(); ++it) {
- if (*it) {
- dbgImage << "Play action : " << (*it)->name();
- KoUpdater* updater =3D 0;
- if(progressUpdater) {
- updater =3D 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/k=
is_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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_MACRO_PLAYER_H_
-#define _KIS_MACRO_PLAYER_H_
-
-#include
-
-#include
-#include
-
-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 =3D 0, QObject* _parent =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_play_info.h"
-
-#include "kis_image.h"
-#include "kis_node.h"
-#include
-
-struct Q_DECL_HIDDEN KisPlayInfo::Private {
- KisImageWSP image;
- KisNodeSP currentNode;
-};
-
-KisPlayInfo::KisPlayInfo(KisImageWSP image, KisNodeSP currentNode)
- : d(new Private)
-{
- d->image =3D image;
- d->currentNode =3D currentNode;
-}
-
-KisPlayInfo::KisPlayInfo(const KisPlayInfo& _rhs) : d(new Private(*_rhs.d))
-{
-}
-
-KisPlayInfo& KisPlayInfo::operator=3D(const KisPlayInfo& _rhs)
-{
- *d =3D *_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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_PLAY_INFO_H_
-#define _KIS_PLAY_INFO_H_
-
-#include
-#include
-
-class KisUndoAdapter;
-
-class KRITAIMAGE_EXPORT KisPlayInfo
-{
-public:
- KisPlayInfo(KisImageWSP image, KisNodeSP currentNodes);
- KisPlayInfo(const KisPlayInfo& _rhs);
- KisPlayInfo& operator=3D(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/record=
er/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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action.h"
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-struct Q_DECL_HIDDEN KisRecordedAction::Private {
- QString name;
- QString id;
-};
-
-KisRecordedAction::KisRecordedAction(const QString& id, const QString& nam=
e) : d(new Private())
-{
- d->name =3D name;
- d->id =3D 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 =3D name;
-}
-
-void KisRecordedAction::toXML(QDomDocument& , QDomElement& elt, KisRecorde=
dActionSaveContext* ) const
-{
- elt.setAttribute("name", name());
- elt.setAttribute("id", id());
-}
-
-struct Q_DECL_HIDDEN KisRecordedActionFactory::Private {
- QString id;
-};
-
-KisRecordedActionFactory::KisRecordedActionFactory(QString id) : d(new Pri=
vate)
-{
- d->id =3D 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/recorde=
r/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
- *
- * 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-13=
01, 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
-#include
-#include
-
-/**
- * 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 =3D 0)=
const =3D 0;
- /**
- * Clone this action.
- */
- virtual KisRecordedAction* clone() const =3D 0;
- virtual void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedAct=
ionSaveContext* ) 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 KisRe=
cordedActionLoadContext*) =3D 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
- *
- * 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-13=
01, 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
-#include
-
-Q_GLOBAL_STATIC(KisRecordedActionFactoryRegistry, s_instance)
-
-
-KisRecordedActionFactoryRegistry* KisRecordedActionFactoryRegistry::instan=
ce()
-{
- 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/l=
ibs/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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_FACTORY_REGISTRY_H_
-
-#include
-
-class KisRecordedActionFactory;
-
-#include
-
-class KRITAIMAGE_EXPORT KisRecordedActionFactoryRegistry : public KoGeneri=
cRegistry
-{
-public:
- KisRecordedActionFactoryRegistry();
- ~KisRecordedActionFactoryRegistry() override;
- static KisRecordedActionFactoryRegistry* instance();
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action_load_context.cpp b/lib=
s/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
- *
- * 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-13=
01, 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
- *
- * 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-13=
01, 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 =
=3D 0;
- virtual KoPattern* pattern(const QString& name) const =3D 0;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_action_save_context.cpp b/lib=
s/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
- *
- * 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-13=
01, 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
- *
- * 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-13=
01, 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) =3D =
0;
- virtual void savePattern(const KoPattern* pattern) =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_fill_paint_action.h"
-
-#include
-
-#include
-
-#include "kis_image.h"
-#include
-#include "kis_node.h"
-#include "kis_node_query_path.h"
-#include
-#include "kis_play_info.h"
-
-struct Q_DECL_HIDDEN KisRecordedFillPaintAction::Private {
- Private(const KisNodeQueryPath& _projectionPath) : projectionPath(_pro=
jectionPath) {}
- 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 =3D pt;
-}
-
-KisRecordedFillPaintAction::KisRecordedFillPaintAction(const KisRecordedFi=
llPaintAction& 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 dev=
ice) const
-{
- return new KisFillPainter(device);
-}
-
-void KisRecordedFillPaintAction::playPaint(const KisPlayInfo& info, KisPai=
nter* _painter) const
-{
- QList nodes =3D d->projectionPath.queryNodes(info.image(), =
info.currentNode());
- KisPaintDeviceSP projection =3D 0;
- if (!nodes.isEmpty())
- {
- projection =3D nodes[0]->projection();
- }
- KisFillPainter* painter =3D static_cast(_painter);
- painter->setWidth(info.image()->width());
- painter->setHeight(info.image()->height());
- if (fillStyle() =3D=3D 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 QDomEl=
ement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode =3D nodeQueryPathFromXML(elt);
- KisNodeQueryPath projectionPathnode =3D KisNodeQueryPath::fromString(e=
lt.attribute("projectionPath"));
-
- int x =3D elt.attribute("x", "0").toInt();
- int y =3D elt.attribute("y", "0").toInt();
-
- KisRecordedFillPaintAction* rplpa =3D new KisRecordedFillPaintAction(p=
athnode, QPoint(x,y), projectionPathnode);
-
- setupPaintAction(rplpa, elt, context);
- return rplpa;
-}
diff --git a/libs/image/recorder/kis_recorded_fill_paint_action.h b/libs/im=
age/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
- *
- * 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-13=
01, 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
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedFillPaintAction : public KisRecordedPai=
ntAction
-{
-public:
-
- KisRecordedFillPaintAction(const KisNodeQueryPath& path, const QPoint&=
pt, const KisNodeQueryPath& projectionPath);
-
- KisRecordedFillPaintAction(const KisRecordedFillPaintAction&);
-
- ~KisRecordedFillPaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- KisPainter* createPainter(KisPaintDeviceSP device) const override;
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const ove=
rride;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedFillPaintActionFactory : public KisRecordedPaintActionFac=
tory
-{
-public:
- KisRecordedFillPaintActionFactory();
- ~KisRecordedFillPaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedAc=
tionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_filter_action.cpp b/libs/imag=
e/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
- *
- * 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-13=
01, USA.
- */
-
-#include "recorder/kis_recorded_filter_action.h"
-#include
-#include
-
-
-#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 =3D filter->defaultConfiguration();
- if (filterConfiguration) {
- filterConfiguration->fromXML(configstr);
- }
- }
- return filterConfiguration;
- }
-
- void setConfiguration(KisFilterConfigurationSP conf) {
- filterConfiguration =3D conf;
- configstr =3D conf->toXML();
- }
-
- void setConfig(const QString& cfg) {
- filterConfiguration =3D 0;
- configstr =3D cfg;
- }
-
- const QString& config() {
- return configstr;
- }
-
-private:
- QString configstr;
- KisFilterConfigurationSP filterConfiguration;
-};
-
-KisRecordedFilterAction::KisRecordedFilterAction(QString name, const KisNo=
deQueryPath& path, const KisFilter* filter, const KisFilterConfigurationSP =
fc) : KisRecordedNodeAction("FilterAction", name, path), d(new Private)
-{
- Q_ASSERT(filter);
- d->filter =3D filter;
- if (fc) {
- d->setConfig(fc->toXML());
- }
-}
-
-KisRecordedFilterAction::KisRecordedFilterAction(const KisRecordedFilterAc=
tion& rhs) : KisRecordedNodeAction(rhs), d(new Private(*rhs.d))
-{
-}
-
-KisRecordedFilterAction::~KisRecordedFilterAction()
-{
- delete d;
-}
-
-void KisRecordedFilterAction::play(KisNodeSP node, const KisPlayInfo& _inf=
o, KoUpdater* _updater) const
-{
- KisFilterConfigurationSP kfc =3D d->configuration();
- KisPaintDeviceSP dev =3D node->paintDevice();
- KisLayerSP layer =3D qobject_cast(node.data());
- QRect r1 =3D dev->extent();
- KisTransaction transaction(kundo2_i18n("Filter: \"%1\"", d->filter->na=
me()), dev);
-
- KisImageWSP image =3D _info.image();
- r1 =3D r1.intersected(image->bounds());
- if (layer && layer->selection()) {
- r1 =3D 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, K=
isRecordedActionSaveContext* context) const
-{
- KisRecordedAction::toXML(doc, elt, context);
- elt.setAttribute("filter", d->filter->id());
- // Save configuration
- KisFilterConfigurationSP kfc =3D d->configuration();
- if (kfc) {
- QDomElement filterConfigElt =3D 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::filterConfiguratio=
n() const
-{
- return d->configuration();
-}
-
-void KisRecordedFilterAction::setFilterConfiguration(KisFilterConfiguratio=
nSP config)
-{
- d->setConfiguration(config);
-}
-
-
-KisRecordedFilterActionFactory::KisRecordedFilterActionFactory() :
- KisRecordedActionFactory("FilterAction")
-{
-}
-
-KisRecordedFilterActionFactory::~KisRecordedFilterActionFactory()
-{
-
-}
-
-KisRecordedAction* KisRecordedFilterActionFactory::fromXML(const QDomEleme=
nt& elt, const KisRecordedActionLoadContext*)
-{
- QString name =3D elt.attribute("name");
- KisNodeQueryPath pathnode =3D KisNodeQueryPath::fromString(elt.attribu=
te("path"));
- const KisFilterSP filter =3D KisFilterRegistry::instance()->get(elt.at=
tribute("filter"));
- if (filter) {
- KisFilterConfigurationSP config =3D filter->defaultConfiguration();
- QDomElement paramsElt =3D elt.firstChildElement("Params");
- if (config && !paramsElt.isNull()) {
- config->fromXML(paramsElt);
- }
- KisRecordedFilterAction* rfa =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_FILTER_ACTION_H_
-#define _KIS_RECORDED_FILTER_ACTION_H_
-
-#include "recorder/kis_recorded_node_action.h"
-
-#include
-
-class QString;
-class KisFilterConfiguration;
-
-/**
- * Action representing a filter.
- */
-class KRITAIMAGE_EXPORT KisRecordedFilterAction : public KisRecordedNodeAc=
tion
-{
-public:
- /**
- * @param config the filter configuration, the ownership of config rem=
ains in the caller.
- */
- KisRecordedFilterAction(QString name, const KisNodeQueryPath& path, co=
nst KisFilter* filter, const KisFilterConfigurationSP config);
- KisRecordedFilterAction(const KisRecordedFilterAction&);
- ~KisRecordedFilterAction() override;
- using KisRecordedNodeAction::play;
- void play(KisNodeSP node, const KisPlayInfo& _info, KoUpdater* _update=
r =3D 0) const override;
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) 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 KisRecordedAc=
tionLoadContext*) override;
-};
-
-#endif
diff --git a/libs/image/recorder/kis_recorded_node_action.cc b/libs/image/r=
ecorder/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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_node_action.h"
-
-#include
-#include
-#include
-
-#include "kis_node_query_path.h"
-#include "kis_play_info.h"
-#include "kis_image.h"
-#include "kis_paint_device.h"
-#include
-
-struct Q_DECL_HIDDEN KisRecordedNodeAction::Private
-{
- Private(const KisNodeQueryPath& _path) : path(_path) {}
- KisNodeQueryPath path;
-};
-
-KisRecordedNodeAction::KisRecordedNodeAction(const QString& id, const QStr=
ing& name, const KisNodeQueryPath& path) : KisRecordedAction(id, name), d(n=
ew 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* _upd=
ater) const
-{
- QList nodes =3D nodeQueryPath().queryNodes(_info.image(), _=
info.currentNode());
- KoProgressUpdater updater(_updater);
- updater.start(nodes.size(), i18n("Applying action to all selected node=
s"));
- 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 =3D nqp;
-}
-
-void KisRecordedNodeAction::toXML(QDomDocument& doc, QDomElement& elt, Kis=
RecordedActionSaveContext* ) const
-{
- Q_UNUSED(doc)
- elt.setAttribute("path", d->path.toString()); =
-}
diff --git a/libs/image/recorder/kis_recorded_node_action.h b/libs/image/re=
corder/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
- *
- * 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-13=
01, 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 Ki=
sNodeQueryPath& path);
- KisRecordedNodeAction(const KisRecordedNodeAction& _rhs);
- ~KisRecordedNodeAction() override;
- /**
- * Play the action on one node
- */
- virtual void play(KisNodeSP node, const KisPlayInfo&, KoUpdater* _upda=
ter) const =3D 0;
- /**
- * Play the action on all the nodes returned by the nodeQueryPath
- */
- void play(const KisPlayInfo& _info, KoUpdater* _updater) const overrid=
e;
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) 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
- *
- * 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-13=
01, USA.
- */
-
-#include //MSVC requires that V=
c come first
-#include "recorder/kis_recorded_paint_action.h"
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include
-#include "kis_paintop_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include
-#include
-#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
-// Recorder
-#include "kis_recorded_action_factory_registry.h"
-#include "kis_recorded_action_load_context.h"
-#include "kis_recorded_action_save_context.h"
-#include
-#include
-#include
-#include
-#include
-
-
-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 =3D paintOpPreset;
- }
- d->opacity =3D 1.0;
- d->paintIncremental =3D true;
- d->compositeOp =3D COMPOSITE_OVER;
- d->strokeStyle =3D KisPainter::StrokeStyleBrush;
- d->fillStyle =3D KisPainter::FillStyleNone;
- d->pattern =3D 0;
- d->gradient =3D 0;
-}
-
-KisRecordedPaintAction::KisRecordedPaintAction(const KisRecordedPaintActio=
n& rhs) : KisRecordedNodeAction(rhs), d(new Private(*rhs.d))
-{
-
-}
-
-KisRecordedPaintAction::~KisRecordedPaintAction()
-{
- delete d;
-}
-
-void KisRecordedPaintAction::toXML(QDomDocument& doc, QDomElement& elt, Ki=
sRecordedActionSaveContext* context) const
-{
- KisRecordedAction::toXML(doc, elt, context);
-
- // Paint op presset
- if (d->paintOpPreset)
- {
- QDomElement paintopPressetElt =3D doc.createElement("PaintopPreset=
");
- d->paintOpPreset->toXML(doc, paintopPressetElt);
- elt.appendChild(paintopPressetElt);
- }
-
- // ForegroundColor
- QDomElement foregroundColorElt =3D doc.createElement("ForegroundColor"=
);
- d->foregroundColor.toXML(doc, foregroundColorElt);
- elt.appendChild(foregroundColorElt);
-
- // BackgroundColor
- QDomElement backgroundColorElt =3D 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 =3D doc.createElement("Generat=
or");
- d->generator->toXML(doc, filterConfigElt);
- elt.appendChild(filterConfigElt);
- }
- break;
- }
-}
-
-KisPaintOpPresetSP KisRecordedPaintAction::paintOpPreset() const
-{
- return d->paintOpPreset;
-}
-
-void KisRecordedPaintAction::setPaintOpPreset(KisPaintOpPresetSP preset)
-{
- d->paintOpPreset =3D preset;
-}
-
-qreal KisRecordedPaintAction::opacity() const
-{
- return d->opacity;
-}
-
-void KisRecordedPaintAction::setOpacity(qreal opacity)
-{
- d->opacity =3D opacity;
-}
-
-KoColor KisRecordedPaintAction::paintColor() const
-{
- return d->foregroundColor;
-}
-
-void KisRecordedPaintAction::setPaintColor(const KoColor& color)
-{
- d->foregroundColor =3D color;
-}
-
-KoColor KisRecordedPaintAction::backgroundColor() const
-{
- return d->backgroundColor;
-}
-
-void KisRecordedPaintAction::setBackgroundColor(const KoColor& color)
-{
- d->backgroundColor =3D color;
-}
-
-QString KisRecordedPaintAction::compositeOp()
-{
- return d->compositeOp;
-}
-
-void KisRecordedPaintAction::setCompositeOp(const QString& id)
-{
- d->compositeOp =3D id;
-}
-
-void KisRecordedPaintAction::setPaintIncremental(bool v)
-{
- d->paintIncremental =3D v;
-}
-
-void KisRecordedPaintAction::setStrokeStyle(KisPainter::StrokeStyle stroke=
Style)
-{
- d->strokeStyle =3D strokeStyle;
-}
-
-void KisRecordedPaintAction::setFillStyle(KisPainter::FillStyle fillStyle)
-{
- d->fillStyle =3D fillStyle;
-}
-
-KisPainter::FillStyle KisRecordedPaintAction::fillStyle() const
-{
- return d->fillStyle;
-}
-
-void KisRecordedPaintAction::setPattern(const KoPattern* pattern)
-{
- d->pattern =3D pattern;
-}
-
-void KisRecordedPaintAction::setGradient(const KoAbstractGradient* gradien=
t)
-{
- d->gradient =3D gradient;
-}
-
-void KisRecordedPaintAction::setGenerator(const KisFilterConfigurationSP =
generator)
-{
- d->generator =3D 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 =3D 0;
- if (d->paintIncremental) {
- target =3D node->paintDevice();
- } else {
- target =3D node->paintDevice()->createCompositionSourceDevice();
- }
-
- KisPainter* painter =3D createPainter(target);
- painter->setProgress(_updater);
-
- if (d->paintIncremental) {
- painter->setCompositeOp(d->compositeOp);
- painter->setOpacity(d->opacity * 255);
- } else {
- painter->setCompositeOp(node->paintDevice()->colorSpace()->composi=
teOp(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 dirtyRects =3D 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(KisRecordedPaintActio=
n* action, const QDomElement& elt, const KisRecordedActionLoadContext* cont=
ext)
-{
- QString name =3D elt.attribute("name");
-
- qreal opacity =3D opacityFromXML(elt);
- dbgKrita << ppVar(opacity);
- bool paintIncremental =3D paintIncrementalFromXML(elt);
-
- QString compositeOp =3D compositeOpFromXML(elt);
- // Decode colors
-
- KoColor bC =3D backgroundColorFromXML(elt);
- KoColor fC =3D 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 =3D elt.attribute("strokeStyle", "None");
- if (strokeAttr =3D=3D "Brush" )
- {
- action->setStrokeStyle(KisPainter::StrokeStyleBrush);
- } else { // "None"
- action->setStrokeStyle(KisPainter::StrokeStyleNone);
- }
- // Save fill style
- QString fillAttr =3D elt.attribute("fillStyle", "None");
- if (fillAttr =3D=3D "PaintColor")
- {
- action->setFillStyle(KisPainter::FillStyleForegroundColor);
- } else if(fillAttr =3D=3D "AlternativeColor")
- {
- action->setFillStyle(KisPainter::FillStyleBackgroundColor);
- } else if(fillAttr =3D=3D "Pattern")
- {
- const KoPattern* pattern =3D context->pattern(elt.attribute("patte=
rn"));
- if (pattern)
- {
- action->setFillStyle(KisPainter::FillStylePattern);
- action->setPattern(pattern);
- } else {
- action->setFillStyle(KisPainter::FillStyleNone);
- }
- } else if(fillAttr =3D=3D "Gradient")
- {
- const KoAbstractGradient* gradient =3D context->gradient(elt.attri=
bute("gradient"));
- if (gradient)
- {
- action->setFillStyle(KisPainter::FillStyleGradient);
- action->setGradient(gradient);
- } else {
- action->setFillStyle(KisPainter::FillStyleNone);
- }
- } else if(fillAttr =3D=3D "Strokes")
- {
- action->setFillStyle(KisPainter::FillStyleStrokes);
- } else if(fillAttr =3D=3D "Generator")
- {
- KisGeneratorSP g =3D KisGeneratorRegistry::instance()->value(elt.a=
ttribute("generator"));
- KisFilterConfigurationSP config =3D 0;
- if (g)
- {
- config =3D g->defaultConfiguration();
- QDomElement paramsElt =3D 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(con=
st QDomElement& elt)
-{
-
- QDomElement settingsElt =3D elt.firstChildElement("PaintopPreset");
- if (!settingsElt.isNull()) {
- KisPaintOpPresetSP settings =3D new KisPaintOpPreset;
- settings->fromXML(settingsElt);
- return settings;
- } else {
- errImage << "No found";
- return 0;
- }
-}
-
-KoColor KisRecordedPaintActionFactory::paintColorFromXML(const QDomElement=
& elt)
-{
- return colorFromXML(elt, "ForegroundColor");
-}
-
-KoColor KisRecordedPaintActionFactory::backgroundColorFromXML(const QDomEl=
ement& elt)
-{
- return colorFromXML(elt, "BackgroundColor");
-}
-
-KoColor KisRecordedPaintActionFactory::colorFromXML(const QDomElement& elt=
, const QString& elementName)
-{
- QDomElement colorElt =3D elt.firstChildElement(elementName);
- KoColor bC;
-
- if (!colorElt.isNull()) {
- bC =3D KoColor::fromXML(colorElt.firstChildElement(), Integer8Bits=
ColorDepthID.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 QDomElem=
ent& elt)
-{
- return KisDomUtils::toInt(elt.attribute("paintIncremental", "1"));
-}
-
-QString KisRecordedPaintActionFactory::compositeOpFromXML(const QDomElemen=
t& 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/r=
ecorder/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
- *
- * 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-13=
01, 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
-
-/**
- * Base class for paint action.
- */
-class KRITAIMAGE_EXPORT KisRecordedPaintAction : public KisRecordedNodeAct=
ion
-{
-public:
-
- KisRecordedPaintAction(const QString & id,
- const QString & name,
- const KisNodeQueryPath& path,
- KisPaintOpPresetSP paintOpPreset);
-
- KisRecordedPaintAction(const KisRecordedPaintAction&);
-
- ~KisRecordedPaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) const override;
-
- using KisRecordedNodeAction::play;
- void play(KisNodeSP node, const KisPlayInfo& info, KoUpdater* _updater=
=3D 0) const override;
-
-protected:
- /**
- * This function will create a painter for the given device. The defau=
lt
- * 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 =
=3D 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) : KisRecordedActionF=
actory(id) {}
- ~KisRecordedPaintActionFactory() override {}
-protected:
-
- void setupPaintAction(KisRecordedPaintAction* action, const QDomElemen=
t& 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& elementNam=
e);
- 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
- *
- * 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-13=
01, USA.
- */
-
-#include //MSVC requires that V=
c come first
-#include "recorder/kis_recorded_path_paint_action.h"
-#include
-#include
-
-#include
-#include
-#include
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include
-#include "kis_paintop_registry.h"
-#include "recorder/kis_recorded_action_factory_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include
-#include
-#include "kis_paint_device.h"
-#include "kis_image.h"
-#include "kis_layer.h"
-#include "kis_node_query_path.h"
-#include
-
-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 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, pr=
eset)
- , d(new Private(startDistInfo))
-{
-}
-
-KisRecordedPathPaintAction::KisRecordedPathPaintAction(const KisRecordedPa=
thPaintAction& 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 =3D startDistInfo;
-}
-
-void KisRecordedPathPaintAction::addPoint(const KisPaintInformation& info)
-{
- Private::BezierCurveSlice slice;
- slice.type =3D Private::BezierCurveSlice::Point;
- slice.point1 =3D info;
- d->curveSlices.append(slice);
-}
-
-void KisRecordedPathPaintAction::addLine(const KisPaintInformation& point1=
, const KisPaintInformation& point2)
-{
- Private::BezierCurveSlice slice;
- slice.type =3D Private::BezierCurveSlice::Line;
- slice.point1 =3D point1;
- slice.point2 =3D point2;
- d->curveSlices.append(slice);
-}
-
-void KisRecordedPathPaintAction::addPolyLine(const QList& points)
-{
- QPointF previousPoint =3D points[0];
- for(int i =3D 1; i < points.size(); ++i) {
- QPointF pt =3D points[i];
- addLine(KisPaintInformation(previousPoint), KisPaintInformation(pt=
));
- previousPoint =3D pt;
- }
-}
-
-
-void KisRecordedPathPaintAction::addCurve(const KisPaintInformation& point=
1,
- const QPointF& control1,
- const QPointF& control2,
- const KisPaintInformation& point2)
-{
- Private::BezierCurveSlice slice;
- slice.type =3D Private::BezierCurveSlice::Curve;
- slice.point1 =3D point1;
- slice.control1 =3D control1;
- slice.control2 =3D control2;
- slice.point2 =3D 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() <=3D 0) return;
-
- KisDistanceInformation savedDist =3D 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, sl=
ice.control2, slice.point2, &savedDist);
- break;
- }
- }
-}
-
-void KisRecordedPathPaintAction::toXML(QDomDocument& doc, QDomElement& elt=
, KisRecordedActionSaveContext* context) const
-{
- KisRecordedPaintAction::toXML(doc, elt, context);
- QDomElement waypointsElt =3D doc.createElement("Slices");
- Q_FOREACH (const Private::BezierCurveSlice & slice, d->curveSlices) {
- switch(slice.type)
- {
- case Private::BezierCurveSlice::Point:
- {
- QDomElement infoElt =3D doc.createElement("Point");
- slice.point1.toXML(doc, infoElt);
-
- waypointsElt.appendChild(infoElt);
- break;
- }
- case Private::BezierCurveSlice::Line:
- {
- QDomElement infoElt =3D doc.createElement("Line");
- // Point1
- QDomElement point1Elt =3D doc.createElement("Point1");
- slice.point1.toXML(doc, point1Elt);
- infoElt.appendChild(point1Elt);
- // Point2
- QDomElement point2Elt =3D doc.createElement("Point2");
- slice.point2.toXML(doc, point2Elt);
- infoElt.appendChild(point2Elt);
-
- waypointsElt.appendChild(infoElt);
- break;
- }
- case Private::BezierCurveSlice::Curve:
- {
- QDomElement infoElt =3D doc.createElement("Curve");
- // Point1
- QDomElement point1Elt =3D doc.createElement("Point1");
- slice.point1.toXML(doc, point1Elt);
- infoElt.appendChild(point1Elt);
- // Control1
- QDomElement control1Elt =3D 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 =3D 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 =3D doc.createElement("Point2");
- slice.point2.toXML(doc, point2Elt);
- infoElt.appendChild(point2Elt);
-
- waypointsElt.appendChild(infoElt);
- }
- }
- }
- elt.appendChild(waypointsElt);
-
- QDomElement initDistElt =3D 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 QDomEl=
ement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode =3D nodeQueryPathFromXML(elt);
-
- // Decode pressets
- KisPaintOpPresetSP paintOpPreset =3D paintOpPresetFromXML(elt);
-
- KisRecordedPathPaintAction* rplpa =3D new KisRecordedPathPaintAction(p=
athnode, paintOpPreset,
- Kis=
DistanceInitInfo());
-
- setupPaintAction(rplpa, elt, context);
-
- QDomElement wpElt =3D elt.firstChildElement("Slices");
- if (!wpElt.isNull()) {
- QDomNode nWp =3D wpElt.firstChild();
- while (!nWp.isNull()) {
- QDomElement eWp =3D nWp.toElement();
- if (!eWp.isNull()) {
- if( eWp.tagName() =3D=3D "Point") {
- rplpa->addPoint(KisPaintInformation::fromXML(eWp));
- } else if(eWp.tagName() =3D=3D "Line") {
- rplpa->addLine(KisPaintInformation::fromXML(eWp.firstC=
hildElement("Point1")),
- KisPaintInformation::fromXML(eWp.first=
ChildElement("Point2")));
- } else if( eWp.tagName() =3D=3D "Curve") {
- QDomElement control1Elt =3D eWp.firstChildElement("Con=
trol1");
- QDomElement control2Elt =3D eWp.firstChildElement("Con=
trol2");
- rplpa->addCurve(KisPaintInformation::fromXML(eWp.first=
ChildElement("Point1")),
- QPointF(KisDomUtils::toDouble(control1=
Elt.attribute("x", "0.0")),
- KisDomUtils::toDouble(control1=
Elt.attribute("y", "0.0"))),
- QPointF(KisDomUtils::toDouble(control2=
Elt.attribute("x", "0.0")),
- KisDomUtils::toDouble(control2=
Elt.attribute("y", "0.0"))),
- KisPaintInformation::fromXML(eWp.first=
ChildElement("Point2")));
- } else {
- dbgImage << "Unsupported <" << eWp.tagName() << " /> e=
lement";
- }
- }
- nWp =3D nWp.nextSibling();
- }
- } else {
- dbgImage << "Warning: no found";
- }
-
- QDomElement initDistInfoElt =3D elt.firstChildElement("StartDistInfo");
- if (!initDistInfoElt.isNull()) {
- rplpa->setInitDistInfo(KisDistanceInitInfo::fromXML(initDistInfoEl=
t));
- } else {
- dbgImage << "Warning: no found";
- }
-
- return rplpa;
-}
-
-
diff --git a/libs/image/recorder/kis_recorded_path_paint_action.h b/libs/im=
age/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
- *
- * 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-13=
01, 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
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedPathPaintAction : public KisRecordedPai=
ntAction
-{
-
-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 KisPaintInformat=
ion& point2);
- void addPolyLine(const QList& points);
- void addCurve(const KisPaintInformation& point1,
- const QPointF& control1,
- const QPointF& control2,
- const KisPaintInformation& point2);
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const ove=
rride;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedPathPaintActionFactory : public KisRecordedPaintActionFac=
tory
-{
-public:
- KisRecordedPathPaintActionFactory();
- ~KisRecordedPathPaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedAc=
tionLoadContext*) 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
- *
- * 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-13=
01, USA.
- */
-
-#include //MSVC requires that V=
c come first
-
-#include "recorder/kis_recorded_shape_paint_action.h"
-
-#include
-#include
-
-#include
-#include
-#include
-#include "kis_node.h"
-#include "kis_mask_generator.h"
-#include "kis_painter.h"
-#include
-#include "kis_paintop_registry.h"
-#include "recorder/kis_recorded_action_factory_registry.h"
-#include "kis_transaction.h"
-#include "kis_undo_adapter.h"
-#include
-#include
-#include "kis_paint_device.h"
-#include "kis_image.h"
-#include "kis_layer.h"
-#include "kis_node_query_path.h"
-#include
-
-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), pa=
th, preset)
- , d(new Private)
-{
- d->shape =3D shape;
- d->rectangle =3D rect;
-}
-
-KisRecordedShapePaintAction::KisRecordedShapePaintAction(const KisRecorded=
ShapePaintAction& 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& el=
t, KisRecordedActionSaveContext* context) const
-{
- KisRecordedPaintAction::toXML(doc, elt, context);
- QDomElement rectangleElt =3D 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 QDomE=
lement& elt, const KisRecordedActionLoadContext* context)
-{
- KisNodeQueryPath pathnode =3D nodeQueryPathFromXML(elt);
-
- // Decode pressets
- KisPaintOpPresetSP paintOpPreset =3D paintOpPresetFromXML(elt);
-
- QDomElement ellipseElt =3D elt.firstChildElement("Rectangle");
- qreal x, y, width, height;
- if (!ellipseElt.isNull()) {
- x =3D KisDomUtils::toDouble(ellipseElt.attribute("x", "0.0"));
- y =3D KisDomUtils::toDouble(ellipseElt.attribute("y", "0.0"));
- width =3D KisDomUtils::toDouble(ellipseElt.attribute("width", "0.0=
"));
- height =3D KisDomUtils::toDouble(ellipseElt.attribute("height", "0=
.0"));
- }
- else {
- x =3D 0;
- y =3D 0;
- width =3D 0;
- height =3D 0;
- dbgImage << "Warning: no found";
- }
-
- KisRecordedShapePaintAction::Shape shape =3D KisRecordedShapePaintActi=
on::Ellipse;
- QString shapeStr =3D elt.attribute("shape", "Ellipse");
- if (shapeStr =3D=3D "Ellipse")
- {
- shape =3D KisRecordedShapePaintAction::Ellipse;
- } else { // shapeStr =3D=3D "Rectangle"
- shape =3D KisRecordedShapePaintAction::Rectangle;
- }
-
- KisRecordedShapePaintAction* rplpa =3D 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/i=
mage/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
- *
- * 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-13=
01, 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
-
-/**
- * This class will record the painting of a bezier curve.
- */
-class KRITAIMAGE_EXPORT KisRecordedShapePaintAction : public KisRecordedPa=
intAction
-{
-public:
- enum Shape {
- Ellipse,
- Rectangle
- };
-public:
-
- KisRecordedShapePaintAction(const KisNodeQueryPath& path,
- const KisPaintOpPresetSP paintOpPres=
et,
- Shape shape,
- const QRectF& rect);
-
- KisRecordedShapePaintAction(const KisRecordedShapePaintAction&);
-
- ~KisRecordedShapePaintAction() override;
-
- void toXML(QDomDocument& doc, QDomElement& elt, KisRecordedActionSaveC=
ontext* ) const override;
-
- KisRecordedAction* clone() const override;
-
-protected:
-
- void playPaint(const KisPlayInfo& info, KisPainter* painter) const ove=
rride;
-
-private:
-
- struct Private;
- Private* const d;
-};
-
-
-class KisRecordedShapePaintActionFactory : public KisRecordedPaintActionFa=
ctory
-{
-public:
- KisRecordedShapePaintActionFactory();
- ~KisRecordedShapePaintActionFactory() override;
- KisRecordedAction* fromXML(const QDomElement& elt, const KisRecordedAc=
tionLoadContext*) 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_mac=
ro_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@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-13=
01, USA.
- */
-
-#include "kis_macro_test.h"
-
-#include
-#include "recorder/kis_macro.h"
-#include
-#include
-#include "kis_image.h"
-
-#include "recorder/kis_recorded_action.h"
-#include
-
-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 actions;
- TestAction tc("bla", "bla");
- actions << &tc;
-
- const KoColorSpace * cs =3D KoColorSpaceRegistry::instance()->rgb8();
- KisImageSP image =3D 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@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-13=
01, USA.
- */
-
-#ifndef KIS_MACRO_TEST_H
-#define KIS_MACRO_TEST_H
-
-#include
-
-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/tes=
ts/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
=
-#include "recorder/kis_node_query_path.h"
+#include "kis_node_query_path.h"
#include
#include
#include
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@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-13=
01, USA.
- */
-
-#include "kis_recorded_action_factory_registry_test.h"
-
-#include
-#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@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-13=
01, USA.
- */
-
-#ifndef KIS_RECORDED_ACTION_FACTORY_REGISTRY_TEST_H
-#define KIS_RECORDED_ACTION_FACTORY_REGISTRY_TEST_H
-
-#include
-
-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/tes=
ts/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@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-13=
01, USA.
- */
-
-#include "kis_recorded_action_test.h"
-
-#include
-#include
-#include "recorder/kis_recorded_action.h"
-#include
-
-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@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-13=
01, USA.
- */
-
-#ifndef KIS_RECORDED_ACTION_TEST_H
-#define KIS_RECORDED_ACTION_TEST_H
-
-#include
-
-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/im=
age/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@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-13=
01, USA.
- */
-
-#include "kis_recorded_filter_action_test.h"
-
-#include
-#include "recorder/kis_recorded_filter_action.h"
-#include
-#include
-#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
-
-void KisRecordedFilterActionTest::testCreation()
-{
- const KoColorSpace * cs =3D KoColorSpaceRegistry::instance()->rgb8();
- KisFilterSP f =3D KisFilterRegistry::instance()->value("invert");
- KisFilterConfigurationSP kfc =3D f->defaultConfiguration();
- KisImageSP image =3D new KisImage(0, 10, 10, cs, "merge test");
- KisPaintLayerSP layer =3D new KisPaintLayer(image, "test", OPACITY_OPA=
QUE_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/imag=
e/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@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-13=
01, USA.
- */
-
-#ifndef KIS_RECORDED_FILTER_ACTION_TEST_H
-#define KIS_RECORDED_FILTER_ACTION_TEST_H
-
-#include
-
-class KisRecordedFilterActionTest : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
-
- void testCreation();
-
-};
-
-#endif
diff --git a/libs/koplugin/KisMimeDatabase.cpp b/libs/koplugin/KisMimeDatab=
ase.cpp
index 6fcf7f874fc..10fb99289c6 100644
--- a/libs/koplugin/KisMimeDatabase.cpp
+++ b/libs/koplugin/KisMimeDatabase.cpp
@@ -227,11 +227,6 @@ void KisMimeDatabase::fillMimeData()
mimeType.suffixes =3D QStringList() << "ocio";
s_mimeDatabase << mimeType;
=
- mimeType.mimeType =3D "application/x-krita-recorded-macro";
- mimeType.description =3D i18nc("description of a file type", "Krit=
a Recorded Action");
- mimeType.suffixes =3D QStringList() << "krarec";
- s_mimeDatabase << mimeType;
-
mimeType.mimeType =3D "application/x-gimp-gradient";
mimeType.description =3D i18nc("description of a file type", "GIMP=
Gradients");
mimeType.suffixes =3D QStringList() << "ggr";
diff --git a/libs/pigment/KoColorSpaceRegistry.h b/libs/pigment/KoColorSpac=
eRegistry.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/wdgpaint=
actioneditor.ui
deleted file mode 100644
index deac79f578e..00000000000
--- a/libs/ui/forms/wdgpaintactioneditor.ui
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
- WdgPaintActionEditor
-
-
-
- 0
- 0
- 405
- 376
-
-
-
- -
-
-
- -
-
-
- 0
-
-
-
- Options
-
-
-
-
-
-
- Paint color:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Background color:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 236
- 147
-
-
-
-
- -
-
-
- Opacity:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 0
-
-
- 100
-
-
- true
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- ...
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- ...
-
-
-
-
-
-
-
- Current preset
-
-
- -
-
-
- Paint op:
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
-
- 0
- 4
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
-
-
-
-
- Preset Collection
-
-
- -
-
-
-
- 4
- 4
-
-
-
-
-
-
-
-
-
-
-
-
- KisColorButton
- QPushButton
-
-
-
- KisIntParseSpinBox
- QSpinBox
-
-
-
- KisPresetChooser
- QWidget
- widgets/kis_preset_chooser.h
- 1
-
-
- KisNodeQueryPathEditor
- QWidget
- recorder/kis_node_query_path_editor.h
- 1
-
-
-
-
-
diff --git a/libs/ui/kis_selection_manager.cc b/libs/ui/kis_selection_manag=
er.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/recor=
der/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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_node_query_path_editor.h"
-
-#include "ui_wdgnodequerypatheditor.h"
-#include
-#include
-#include
-
-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(c=
urrentLayerEnabled(bool)));
- connect(d->form.radioButtonCustomPath, SIGNAL(clicked(bool)), SLOT(cus=
tomPathEnabled(bool)));
- =
- d->form.kpushbutton->setIcon(KisIconUtils::loadIcon("system-help"));
- connect(d->form.kpushbutton, SIGNAL(clicked()), this, SLOT(slotPopupQu=
ickHelp()));
- currentLayerEnabled(true);
-
- connect(d->form.klineeditPath, SIGNAL(textChanged(QString)), SIGNAL(no=
deQueryPathChanged()));
-}
-
-KisNodeQueryPathEditor::~KisNodeQueryPathEditor()
-{
- delete d;
-}
-
-void KisNodeQueryPathEditor::setNodeQueryPath(const KisNodeQueryPath& path)
-{
- if(path.toString() =3D=3D ".")
- {
- 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(
- "/ represents the root of the image, or a separator
\=
n"
- "a number represents a layer
\n"
- ". represents the current layer
\n"
- ".. represents the parent layer
\n\n"
- "Examples:
\n"
- "/0 represents the bottom layer of the image
\n"
- "../1 represents the second layer from the bottom of the =
parent of the current layer
\n"
- "./0 represents the first child of the current layer" ) );
-}
-
diff --git a/libs/ui/recorder/kis_node_query_path_editor.h b/libs/ui/record=
er/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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_NODE_QUERY_PATH_EDITOR_H_
-#define _KIS_NODE_QUERY_PATH_EDITOR_H_
-
-#include
-
-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/reco=
rder/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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_creator.h"
-
-KisRecordedActionCreator::KisRecordedActionCreator(QWidget* parent, Qt::Wi=
ndowFlags f)
- : QWidget(parent, f)
- , d(0)
-{
-}
-
-KisRecordedActionCreator::~KisRecordedActionCreator()
-{
- // delete d;
-}
-
diff --git a/libs/ui/recorder/kis_recorded_action_creator.h b/libs/ui/recor=
der/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
- *
- * 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-13=
01, USA.
- */
-#ifndef KIS_RECORDED_ACTION_CREATOR
-#define KIS_RECORDED_ACTION_CREATOR
-#include
-
-class KisRecordedAction;
-
-class KisRecordedActionCreator : public QWidget {
-public:
- explicit KisRecordedActionCreator(QWidget* parent =3D 0, Qt::WindowFla=
gs f =3D 0);
- ~KisRecordedActionCreator() override;
- /**
- * This function is called when the dialog is closed and the action ha=
s to be created
- * from the parameters in the widget.
- */
- virtual KisRecordedAction* createAction() const =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_creator_factory.h"
-
-#include
-
-struct KisRecordedActionCreatorFactory::Private {
- QString id;
- QString name;
-};
-
-KisRecordedActionCreatorFactory::KisRecordedActionCreatorFactory(const QSt=
ring& _id, const QString& _name) : d(new Private)
-{
- d->id =3D _id;
- d->name =3D _name;
-}
-
-KisRecordedActionCreatorFactory::~KisRecordedActionCreatorFactory()
-{
- delete d;
-}
-
-QString KisRecordedActionCreatorFactory::id() const
-{
- return d->id;
-}
-
-QString KisRecordedActionCreatorFactory::name() const
-{
- return d->name;
-}
-
-KisRecordedActionCreator* KisRecordedActionCreatorFactory::createCreator(Q=
Widget* /*parent*/) const
-{
- Q_ASSERT(requireCreator() =3D=3D false);
- return 0;
-}
-
-KisRecordedAction* KisRecordedActionCreatorFactory::createAction() const
-{
- Q_ASSERT(requireCreator() =3D=3D 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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_CREATOR_FACTORY_H_
-#define _KIS_RECORDED_ACTION_CREATOR_FACTORY_H_
-
-#include
-
-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& _na=
me);
- virtual ~KisRecordedActionCreatorFactory();
- QString id() const;
- QString name() const;
- /**
- * @return true if the creation of this action require the use of a cr=
eator widget
- */
- virtual bool requireCreator() const =3D 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_creator_factory_registry.h"
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include "kis_recorded_action_creator_factory.h"
-#include "kis_recorded_filter_action_creator.h"
-
-Q_GLOBAL_STATIC(KisRecordedActionCreatorFactoryRegistry, s_instance)
-
-struct KisRecordedActionCreatorFactoryRegistry::Private {
- KoGenericRegistry factories;
-};
-
-KisRecordedActionCreatorFactoryRegistry::KisRecordedActionCreatorFactoryRe=
gistry()
- : d(new Private)
-{
- add(new KisRecordedFilterActionCreatorFactory);
-}
-
-KisRecordedActionCreatorFactoryRegistry::~KisRecordedActionCreatorFactoryR=
egistry()
-{
- delete d;
-}
-
-KisRecordedActionCreatorFactoryRegistry* KisRecordedActionCreatorFactoryRe=
gistry::instance()
-{
- return s_instance;
-}
-
-void KisRecordedActionCreatorFactoryRegistry::add(KisRecordedActionCreator=
Factory* factory)
-{
- d->factories.add(factory);
-}
-
-KisRecordedActionCreatorFactory* KisRecordedActionCreatorFactoryRegistry::=
get(const QString& _id) const
-{
- return d->factories.get(_id);
-}
-
-QList KisRecordedActionCreatorFactoryRegistry::creators() const
-{
- QList 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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_CREATOR_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_CREATOR_FACTORY_REGISTRY_H_
-
-#include
-#include
-
-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 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_editor_factory.h"
-
-struct KisRecordedActionEditorFactory::Private {
-
-};
-
-KisRecordedActionEditorFactory::KisRecordedActionEditorFactory() : d(new P=
rivate)
-{
-}
-
-KisRecordedActionEditorFactory::~KisRecordedActionEditorFactory()
-{
- delete d;
-}
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory.h b/libs/u=
i/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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_EDITOR_FACTORY_H_
-#define _KIS_RECORDED_ACTION_EDITOR_FACTORY_H_
-
-#include
-
-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 emi=
tted
- * when the editor has changed one of the parameter of the action.
- */
- virtual QWidget* createEditor(QWidget* parent, KisRecordedAction* acti=
on) const =3D 0;
- /**
- * @return true if this factory can create an editor for the given act=
ion.
- */
- virtual bool canEdit(const KisRecordedAction* action) const =3D 0;
-private:
- struct Private;
- Private* const d;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_action_editor_factory_registry.c=
c 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_editor_factory_registry.h"
-
-#include
-#include
-#include
-#include
-
-#include
-#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::KisRecordedActionEditorFactoryRegi=
stry()
- : d(new Private)
-{
- add(new KisRecordedFilterActionEditorFactory);
- add(new KisRecordedPaintActionEditorFactory);
-}
-
-KisRecordedActionEditorFactoryRegistry::~KisRecordedActionEditorFactoryReg=
istry()
-{
- dbgRegistry << "Deleting KisRecordedActionEditorFactoryRegistry";
- qDeleteAll(d->factories);
- delete d;
-}
-
-KisRecordedActionEditorFactoryRegistry* KisRecordedActionEditorFactoryRegi=
stry::instance()
-{
- return s_instance;
-}
-
-void KisRecordedActionEditorFactoryRegistry::add(KisRecordedActionEditorFa=
ctory* factory)
-{
- if (d->factories.contains(factory)) return;
- d->factories.push_front(factory);
-}
-
-QWidget* KisRecordedActionEditorFactoryRegistry::createEditor(QWidget* par=
ent, KisRecordedAction* action) const
-{
- Q_FOREACH (KisRecordedActionEditorFactory* factory, d->factories) {
- if (factory->canEdit(action)) {
- QWidget* editor =3D factory->createEditor(parent, action);
- Q_ASSERT(editor);
- Q_ASSERT(editor->metaObject()->indexOfSignal("actionEdited()")=
!=3D -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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_ACTION_EDITOR_FACTORY_REGISTRY_H_
-#define _KIS_RECORDED_ACTION_EDITOR_FACTORY_REGISTRY_H_
-
-#include
-
-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) cons=
t;
- /**
- * @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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_filter_action_creator.h"
-
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-KisRecordedFilterActionCreator::KisRecordedFilterActionCreator(QWidget* pa=
rent , Qt::WindowFlags f)
- : KisRecordedActionCreator(parent, f)
-{
- m_filterModel =3D new KisFiltersModel(true, 0);
- m_filterTree =3D new QTreeView(this);
- m_filterTree->setModel(m_filterModel);
- m_filterTree->header()->setVisible(false);
- QGridLayout* layout =3D 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 =3D m_filterModel->indexToFilter(m_filterTree-=
>currentIndex());
- if(!filter) return 0;
- return new KisRecordedFilterAction(filter->name(), KisNodeQueryPath::f=
romString(""), filter, filter->defaultConfiguration());
-}
-
-
-KisRecordedFilterActionCreatorFactory::KisRecordedFilterActionCreatorFacto=
ry()
- : KisRecordedActionCreatorFactory("filter", i18nc("recorded filter act=
ion", "Apply Filter"))
-{
-}
-
-KisRecordedFilterActionCreatorFactory::~KisRecordedFilterActionCreatorFact=
ory()
-{
-}
-
-bool KisRecordedFilterActionCreatorFactory::requireCreator() const
-{
- return true;
-}
-
-KisRecordedActionCreator* KisRecordedFilterActionCreatorFactory::createCre=
ator(QWidget* parent) const
-{
- return new KisRecordedFilterActionCreator(parent);
-}
diff --git a/libs/ui/recorder/kis_recorded_filter_action_creator.h b/libs/u=
i/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
- *
- * 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-13=
01, 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 =3D 0, Qt::Win=
dowFlags f =3D 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 KisRecordedActionCrea=
torFactory
-{
-public:
- KisRecordedFilterActionCreatorFactory();
- ~KisRecordedFilterActionCreatorFactory() override;
- bool requireCreator() const override;
- KisRecordedActionCreator* createCreator(QWidget* parent) const overrid=
e;
-};
-
-#endif
diff --git a/libs/ui/recorder/kis_recorded_filter_action_editor.cc b/libs/u=
i/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
- *
- * 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-13=
01, USA.
- */
-
-
-#include
-#include "kis_recorded_filter_action_editor.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "kis_node_query_path_editor.h"
-#include
-#include
-
-KisRecordedFilterActionEditor::KisRecordedFilterActionEditor(QWidget* pare=
nt, KisRecordedAction* action)
- : QWidget(parent)
- , m_action(dynamic_cast(action))
- , m_gridLayout(new QGridLayout(this))
-{
- Q_ASSERT(m_action);
-
- // Create the node query path editor
- m_nodeQueryPathEditor =3D new KisNodeQueryPathEditor(this);
- m_nodeQueryPathEditor->setNodeQueryPath(m_action->nodeQueryPath());
- connect(m_nodeQueryPathEditor, SIGNAL(nodeQueryPathChanged()), SLOT(no=
deQueryPathChanged()));
- m_gridLayout->addWidget(m_nodeQueryPathEditor, 1, 0);
-
- // Create the filter editor
- m_configWidget =3D 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()), SLO=
T(configurationUpdated()));
- } else {
- m_gridLayout->addWidget(new QLabel(i18n("No configuration option."=
), this));
- }
-}
-
-KisRecordedFilterActionEditor::~KisRecordedFilterActionEditor()
-{
-}
-
-void KisRecordedFilterActionEditor::configurationUpdated()
-{
- KisFilterConfigurationSP config =3D dynamic_cast(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::~KisRecordedFilterActionEditorFactor=
y()
-{
-}
-
-QWidget* KisRecordedFilterActionEditorFactory::createEditor(QWidget* paren=
t, KisRecordedAction* action) const
-{
- return new KisRecordedFilterActionEditor(parent, action);
-}
-
-bool KisRecordedFilterActionEditorFactory::canEdit(const KisRecordedAction=
* action) const
-{
- return action->id() =3D=3D "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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_FILTER_ACTION_EDITOR_H_
-#define _KIS_RECORDED_FILTER_ACTION_EDITOR_H_
-
-#include
-#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* acti=
on);
- ~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 KisRecordedActionEdito=
rFactory
-{
-public:
- KisRecordedFilterActionEditorFactory();
- ~KisRecordedFilterActionEditorFactory() override;
- QWidget* createEditor(QWidget* parent, KisRecordedAction* action) cons=
t 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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_paint_action_editor.h"
-
-#include
-#include
-
-#include
-
-#include "recorder/kis_recorded_paint_action.h"
-#include
-#include
-#include
-
-#include "ui_wdgpaintactioneditor.h"
-#include
-#include
-#include "kis_node_query_path_editor.h"
-#include
-
-KisRecordedPaintActionEditor::KisRecordedPaintActionEditor(QWidget* parent=
, KisRecordedAction* action) : QWidget(parent),
- m_action(dynamic_cast(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(confi=
gurationUpdated()));
-
- // Setup paint ops
-
- QList keys =3D KisPaintOpRegistry::instance()->listKeys();
- Q_FOREACH (const KoID& paintopId, keys) {
- QIcon pm =3D KisPaintOpRegistry::instance()->icon(paintopId);
-
- m_actionEditor->paintOps->addItem(pm, paintopId.name());
- m_paintops.append(paintopId.id());
- }
- connect(m_actionEditor->paintOps, SIGNAL(activated(int)), SLOT(paintOp=
Changed(int)));
-
- // Setup configuration widget for paint op settings
- m_gridLayout =3D new QGridLayout(m_actionEditor->frmOptionWidgetContai=
ner);
- setPaintOpPreset();
- m_actionEditor->paintOps->setCurrentIndex(m_paintops.indexOf(m_action-=
>paintOpPreset()->paintOp().id()));
- m_paintOpsToPreset[m_action->paintOpPreset()->paintOp().id()] =3D m_ac=
tion->paintOpPreset();
- connect(m_actionEditor->wdgPresetChooser, SIGNAL(resourceSelected(KoRe=
source*)), SLOT(resourceSelected(KoResource*)));
-
- // Setup the query path editor
- m_actionEditor->nodeQueryPathEditor->setNodeQueryPath(m_action->nodeQu=
eryPath());
- connect(m_actionEditor->nodeQueryPathEditor, SIGNAL(nodeQueryPathChang=
ed()), SLOT(nodeQueryPathChanged()));
- =
-}
-
-KisRecordedPaintActionEditor::~KisRecordedPaintActionEditor()
-{
- delete m_actionEditor;
-}
-
-void KisRecordedPaintActionEditor::configurationUpdated()
-{
- m_configWidget->writeConfigurationSafe(const_cast=
(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 =3D m_paintops[index];
- KisPaintOpPresetSP preset =3D m_paintOpsToPreset[id];
- if (!preset) {
- preset =3D KisPaintOpRegistry::instance()->defaultPreset(KoID(id, =
""));
- m_paintOpsToPreset[id] =3D preset;
- }
- m_action->setPaintOpPreset(preset);
- setPaintOpPreset();
-}
-
-void KisRecordedPaintActionEditor::resourceSelected(KoResource* resource)
-{
- KisPaintOpPresetSP preset =3D static_cast(resource);
-
- m_paintOpsToPreset[preset->paintOp().id()] =3D preset;
- m_action->setPaintOpPreset(preset);
- setPaintOpPreset();
-}
-
-void KisRecordedPaintActionEditor::nodeQueryPathChanged()
-{
- m_action->setNodeQueryPath(m_actionEditor->nodeQueryPathEditor->nodeQu=
eryPath());
- emit(actionEdited());
-}
-
-
-void KisRecordedPaintActionEditor::setPaintOpPreset()
-{
- delete m_configWidget;
- m_configWidget =3D KisPaintOpRegistry::instance()->get(m_action->paint=
OpPreset()->paintOp().id())->createConfigWidget(m_actionEditor->frmOptionWi=
dgetContainer);
- if (m_configWidget) {
- m_gridLayout->addWidget(m_configWidget);
- //TODO use default configuration instead?
- //m_configWidget->setConfiguration(m_action->paintOpPreset()->sett=
ings());
- connect(m_configWidget, SIGNAL(sigConfigurationUpdated()), SLOT(co=
nfigurationUpdated()));
- } 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(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
- *
- * 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-13=
01, USA.
- */
-
-#ifndef _KIS_RECORDED_PAINT_ACTION_EDITOR_H_
-#define _KIS_RECORDED_PAINT_ACTION_EDITOR_H_
-
-#include
-#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* actio=
n);
- ~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 m_paintops;
- QMap m_paintOpsToPreset;
-};
-
-class KisRecordedPaintActionEditorFactory : public KisRecordedActionEditor=
Factory
-{
-public:
- KisRecordedPaintActionEditorFactory();
- ~KisRecordedPaintActionEditorFactory() override;
- QWidget* createEditor(QWidget* parent, KisRecordedAction* action) cons=
t 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/te=
sts/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
- *
- * 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-13=
01, USA.
- */
-
-#include "kis_recorded_action_editor_test.h"
-
-#include
-
-#include
-#include
-#include
-#include