Commit 5f241f2c authored by Boudewijn Rempt's avatar Boudewijn Rempt

CCMAIL:kimageshop@kde.org

* Make masks and layers inherit a common baseclass: KisNode. Create
  code in krita/image to handle the new layer hierarchy.
* Remove KisMetaRegistry
* Remove the "super" typedefs
* Fix bugs demonstrated by unittests
* Add several unittests -- some show that we have some bugs still.
* Considerably simplify the api of KisPaintDevice and Kisimage 
* Add several more options for perfomance and tweak others to give
  better performance by default
* Sanitize the dirty setting of rects
* Start working on extracting the prescaling and canvas preview update
  spaghetti into a separate class.
* Re-instate the fast-but-ugly nearest-neighbour scale option (doesn't
  work yet, is part of the above)

Warning: this commit breaks some stuff, notably the adding of layers
and masks. Painting, redisplay using QPainter and opengl and selections
should be fine, without regressions. I am still working on the layer/mask
issue and on the display thing, but apart from these two issues, Krita
is reasonably stable again. There are two Umbrello diagrams in krita/doc
that show the new layer design and the way the selection classes fit 
together.


svn path=/trunk/koffice/; revision=701132
parent fcaf1271
EXCLUDE explicit
SKIP /colorspaces/wetsticky/ws/\|/colorspaces/wet/wetdreams/\|/plugins/filters/cimg/CImg\.h\|/ui/obsolete
......@@ -2,7 +2,6 @@ project(krita)
if (SHOULD_BUILD_KRITA)
macro_optional_find_package(Kunittest)
include(CheckFunctionExists)
macro_optional_find_package(GLEW)
......@@ -20,13 +19,6 @@ if (SHOULD_BUILD_KRITA)
message(STATUS "hardware accelerated rendering.")
endif(HAVE_OPENGL)
# if(X11_Xinput_FOUND)
# set(HAVE_XINPUTEXT 1)
# message(STATUS "Found XInput extension")
# else(X11_Xinput_FOUND)
# set(HAVE_XINPUTEXT 0)
# endif(X11_Xinput_FOUND)
set(HAVE_XINPUTEXT 0)
if(UNIX)
......
########### next target ###############
set(krita_gray_u16_LIB_SRCS kis_gray_u16_colorspace.cc )
kde4_add_library(krita_gray_u16 SHARED ${krita_gray_u16_LIB_SRCS})
target_link_libraries(krita_gray_u16 ${KDE4_KDECORE_LIBS} pigment )
set_target_properties(krita_gray_u16 PROPERTIES VERSION ${GENERIC_KOFFICE_LIB_VERSION} SOVERSION ${GENERIC_KOFFICE_LIB_SOVERSION} )
install(TARGETS krita_gray_u16 DESTINATION ${LIB_INSTALL_DIR})
########### next target ###############
set(krita_gray_u16_plugin_PART_SRCS gray_u16_plugin.cc )
set(krita_gray_u16_plugin_PART_SRCS gray_u16_plugin.cc kis_gray_u16_colorspace.cc )
kde4_add_plugin(krita_gray_u16_plugin ${krita_gray_u16_plugin_PART_SRCS})
target_link_libraries(krita_gray_u16_plugin ${KDE4_KDECORE_LIBS} krita_gray_u16 pigment )
target_link_libraries(krita_gray_u16_plugin ${KDE4_KDECORE_LIBS} pigment )
install(TARGETS krita_gray_u16_plugin DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -33,4 +12,3 @@ install(TARGETS krita_gray_u16_plugin DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
install( FILES krita_gray_u16_plugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
......@@ -36,9 +36,10 @@ GRAYU16Plugin::GRAYU16Plugin(QObject *parent, const QStringList &)
KoColorSpaceRegistry * f = KoColorSpaceRegistry::instance();
KoColorSpaceFactory * csf = new KisGrayU16ColorSpaceFactory();
f->add(csf);
KoColorSpace * colorSpaceGRAYU16 = new KisGrayU16ColorSpace(f, KoColorSpaceRegistry::instance()->profileByName(csf->defaultProfile()));
Q_CHECK_PTR(colorSpaceGRAYU16);
f->add(csf);
KoHistogramProducerFactoryRegistry::instance()->add(
new KoBasicHistogramProducerFactory<KoBasicU16HistogramProducer>
......
......@@ -27,7 +27,7 @@
#include "compositeops/KoCompositeOpErase.h"
KisGrayColorSpace ::KisGrayColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) :
KoLcmsColorSpace<GrayU8Traits>("GRAYU8", i18n("Grayscale 8-bit integer/channel)"), parent, TYPE_GRAY_8, icSigGrayData, p)
KoLcmsColorSpace<GrayU8Traits>("GRAYU8", i18n("Grayscale without alpha (8-bit integer/channel)"), parent, TYPE_GRAY_8, icSigGrayData, p)
{
addChannel(new KoChannelInfo(i18n("Gray"), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8));
......
......@@ -31,14 +31,15 @@
#include "kis_texture_painter.h"
KisTexturePainter::KisTexturePainter()
: super()
: KisPainter()
{
// XXX make at least one of these configurable, probably blurh
m_height = 1;
m_blurh = 0.7;
}
KisTexturePainter::KisTexturePainter(KisPaintDeviceSP device) : super(device)
KisTexturePainter::KisTexturePainter(KisPaintDeviceSP device)
: KisPainter(device)
{
m_height = 1;
m_blurh = 0.7;
......
......@@ -24,8 +24,6 @@
class KisTexturePainter : public KisPainter
{
typedef KisPainter super;
public:
KisTexturePainter();
......
......@@ -37,7 +37,7 @@
#include <knuminput.h>
#include <khbox.h>
#include <kis_meta_registry.h>
#include <kis_factory.h>
#include <kis_canvas_subject.h>
#include <KoColorSpaceRegistry.h>
......@@ -47,7 +47,8 @@
#include "kis_wet_colorspace.h"
#include "kis_wet_palette_widget.h"
KisWetPaletteWidget::KisWetPaletteWidget(QWidget *parent, const char *name) : super(parent)
KisWetPaletteWidget::KisWetPaletteWidget(QWidget *parent, const char *name)
: QWidget(parent)
{
setObjectName(name);
......
......@@ -36,7 +36,6 @@ class KRITAUI_EXPORT KisWetPaletteWidget
public KisCanvasObserver
{
Q_OBJECT
typedef QWidget super;
public:
KisWetPaletteWidget(QWidget *parent = 0L, const char *name = 0);
......
......@@ -21,7 +21,7 @@
#include <klocale.h>
#include <ktoggleaction.h>
#include "kis_meta_registry.h"
#include <kis_view.h>
#include <kis_image.h>
#include <KoColorSpaceRegistry.h>
......
......@@ -28,7 +28,7 @@
#include <kis_paintop.h>
#include <kis_iterators_pixel.h>
#include <kis_layer.h>
#include <kis_meta_registry.h>
#include <KoColorSpaceRegistry.h>
#include "KoInputDevice.h"
......@@ -36,7 +36,7 @@
#include "kis_wet_colorspace.h"
KisWetOpSettings::KisWetOpSettings(QWidget *parent)
: super(parent)
: KisPaintOpSettings(parent)
{
m_options = new WetPaintOptions(parent, "wet option widget");
}
......@@ -77,7 +77,7 @@ KisPaintOpSettings* KisWetOpFactory::settings(QWidget * parent, const KoInputDev
}
KisWetOp::KisWetOp(const KisWetOpSettings * settings, KisPainter * painter)
: super(painter)
: KisPaintOp(painter)
{
if (settings) {
m_size = settings->varySize();
......
......@@ -48,7 +48,7 @@ public:
};
class KisWetOpSettings : public KisPaintOpSettings {
typedef KisPaintOpSettings super;
public:
KisWetOpSettings(QWidget *parent);
......@@ -64,7 +64,6 @@ private:
class KisWetOp : public KisPaintOp {
typedef KisPaintOp super;
bool m_size;
bool m_wetness;
bool m_strength;
......
......@@ -36,7 +36,7 @@
#include <KoMainWindow.h>
#include "kis_meta_registry.h"
#include <kis_factory.h>
#include <kis_image.h>
#include <kis_types.h>
......
KDE_CHECK_LIB(Xi, XOpenDisplay, [
LIB_XINPUTEXT="-lXi"
AC_DEFINE(HAVE_XINPUTEXT, 1, [Define if you have the X11 Input Extension])
])
AC_SUBST(LIB_XINPUTEXT)
# Check for lcms
AC_MSG_CHECKING([for lcms >= 1.12])
have_lcms_header='no'
KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
if test "$have_lcms_header" = 'yes'
then
AC_DEFINE(LCMS_HEADER, <lcms/lcms.h>, [The correct header])
echo "#include <lcms/lcms.h>" > conftest.$ac_ext
echo "#if LCMS_VERSION < 112" >> conftest.$ac_ext
echo "#error Need lcms >= 1.12" >> conftest.$ac_ext
echo "#endif" >> conftest.$ac_ext
echo "int main() {}" >> conftest.$ac_ext
else
# Alternative! Debian does it this way...
KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
AC_DEFINE(LCMS_HEADER, <lcms.h>, [The correct header])
echo "#include <lcms.h>" > conftest.$ac_ext
echo "#if LCMS_VERSION < 112" >> conftest.$ac_ext
echo "#error Need lcms >= 1.12" >> conftest.$ac_ext
echo "#endif" >> conftest.$ac_ext
echo "int main() {}" >> conftest.$ac_ext
fi
ac_link='$LIBTOOL_SHELL --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext -llcms 1>&5'
if AC_TRY_EVAL(ac_link) && test -s conftest; then
AC_MSG_RESULT(yes)
HAVELCMS="yes"
LCMS_LIBS="-llcms"
else
AC_MSG_RESULT(no)
HAVELCMS="no"
LCMS_LIBS=""
DO_NOT_COMPILE="$DO_NOT_COMPILE krita"
fi
AC_SUBST(LCMS_LIBS)
# Check if the 1.14 version of lcms is detected
if test ! "$LCMS_LIBS" = ""
then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(
[#include LCMS_HEADER
#if LCMS_VERSION == 114
#error lcms 1.14 detected
#endif ] , [ ], lcms_version_114='no', lcms_version_114='yes' )
AC_LANG_RESTORE
fi
# IM 6.1.3 changed the number of arguments to GetMagickInfoList
AC_MSG_CHECKING(if GetMagickInfoList has only 2 arguments)
CPPFLAGS_TMP="$CPPFLAGS" # Save preprocessor flags
CPPFLAGS="$LIBMAGICK_CPPFLAGS"
AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
[const char *pattern; unsigned long ncolors; (void)GetMagickInfoList(pattern, &ncolors)],
magick_info_list='yes',
magick_info_list='no')
CPPFLAGS="$CPPFLAGS_TMP" # Restore preprocessor flags
if test "$magick_info_list" = 'yes'; then
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_OLD_GETMAGICKINFOLIST], 1, [GetMagickInfoList has different number of arguments with versions >= 6.1.3])
else
AC_MSG_RESULT(no)
fi
# Check for kunittest
AC_MSG_CHECKING([for kunittest])
have_kunittest_header="no"
KDE_CHECK_HEADER(kunittest/tester.h, have_kunittest_header="yes", , )
AM_CONDITIONAL(include_kunittest_tests, test "$have_kunittest_header" = "yes")
# --- OpenGL check ---
AC_HAVE_GL( [], [] )
# --- End of OpenGL check ---
......@@ -20,6 +20,21 @@
Both libraries are used by the user interface, which is a KOffice
part. the user interface loads tools and other plugins.
There are the following types of plugins
<ul>
<li> filters
<li> tools
<li> paintops
<li> colorspaces
<li> file filters
<li> view plugins
</u>
Of these, file filters exist outside the Krita tree and colorspaces
depend only on pigment, which is also outside krita itself. Please
consult the plugin writers' manual for more information.
*/
#ifndef DESIGN
#define DESIGN
......
<?xml version="1.0" encoding="UTF-8"?>
<XMI xmlns:UML="http://schema.omg.org/spec/UML/1.3" verified="false" timestamp="2007-07-26T18:13:29" xmi.version="1.2" >
<XMI xmlns:UML="http://schema.omg.org/spec/UML/1.3" verified="false" timestamp="2007-08-17T13:42:02" xmi.version="1.2" >
<XMI.header>
<XMI.documentation>
<XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
......@@ -135,10 +135,16 @@
<UML:Generalization isSpecification="false" child="6hIcHyBenVkh" visibility="public" namespace="Logical View" xmi.id="1xsxWutJGV0N" parent="942XkzWxwv2Y" discriminator="" name="" />
<UML:Generalization isSpecification="false" child="32s6wm7COWOm" visibility="public" namespace="Logical View" xmi.id="WFykkw8QV76E" parent="942XkzWxwv2Y" discriminator="" name="" />
<UML:Generalization isSpecification="false" child="2IMfrnaxUqXj" visibility="public" namespace="Logical View" xmi.id="Mqiqvm4KLqck" parent="942XkzWxwv2Y" discriminator="" name="" />
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="Logical View" xmi.id="XQyb0Na5Qywe" isRoot="false" isAbstract="false" name="KisSelectionMask" >
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="jRmBg9Xtp3mB" />
</UML:GeneralizableElement.generalization>
</UML:Class>
<UML:Generalization isSpecification="false" child="XQyb0Na5Qywe" visibility="public" namespace="Logical View" xmi.id="jRmBg9Xtp3mB" parent="942XkzWxwv2Y" discriminator="" name="" />
</UML:Namespace.ownedElement>
<XMI.extension xmi.extender="umbrello" >
<diagrams>
<diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="1243" snapy="10" showatts="1" xmi.id="eM4mV4kVVzFl" documentation="" type="1" showops="1" showpackage="0" name="class diagram" localid="" showstereotype="0" showscope="1" snapcsgrid="0" font="Bitstream Vera Sans,10,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="899" >
<diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="100" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="1259" snapy="10" showatts="1" xmi.id="eM4mV4kVVzFl" documentation="" type="1" showops="1" showpackage="0" name="class diagram" localid="" showstereotype="0" showscope="1" snapcsgrid="0" font="Bitstream Vera Sans,10,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="897" >
<widgets>
<classwidget usesdiagramfillcolor="1" width="91" showattsigs="601" x="220" fillcolor="none" y="230" showopsigs="601" linewidth="none" height="44" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="13WT2dgbr7dB" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
<classwidget usesdiagramfillcolor="1" width="107" showattsigs="601" x="40" fillcolor="none" y="210" showopsigs="601" linewidth="none" height="46" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="987oy9O3SQFL" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
......@@ -155,37 +161,38 @@
<classwidget usesdiagramfillcolor="1" width="237" showattsigs="601" x="720" fillcolor="none" y="260" showopsigs="601" linewidth="none" height="44" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="6hIcHyBenVkh" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
<classwidget usesdiagramfillcolor="1" width="142" showattsigs="601" x="720" fillcolor="none" y="200" showopsigs="601" linewidth="none" height="44" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="32s6wm7COWOm" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
<classwidget usesdiagramfillcolor="1" width="219" showattsigs="601" x="720" fillcolor="none" y="340" showopsigs="601" linewidth="none" height="44" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="2IMfrnaxUqXj" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
<classwidget usesdiagramfillcolor="1" width="180" showattsigs="601" x="710" fillcolor="none" y="30" showopsigs="601" linewidth="none" height="44" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="XQyb0Na5Qywe" showoperations="1" showpackage="0" showscope="1" usesdiagramusefillcolor="1" font="Bitstream Vera Sans,10,-1,5,75,0,0,0,0,0" linecolor="none" />
</widgets>
<messages/>
<associations>
<assocwidget totalcounta="3" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="987oy9O3SQFL" widgetaid="13WT2dgbr7dB" xmi.id="qJfJrsALtA7I" type="500" linecolor="none" >
<linepath>
<startpoint startx="220" starty="240" />
<endpoint endx="147" endy="230" />
<startpoint startx="220" starty="230" />
<endpoint endx="150" endy="230" />
</linepath>
</assocwidget>
<assocwidget totalcounta="3" indexa="2" totalcountb="2" indexb="1" linewidth="none" widgetbid="M0kFlWhnZCEb" widgetaid="13WT2dgbr7dB" xmi.id="Vr2O07gzO7UF" type="500" linecolor="none" >
<linepath>
<startpoint startx="220" starty="260" />
<endpoint endx="148" endy="300" />
<startpoint startx="220" starty="270" />
<endpoint endx="150" endy="280" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="13WT2dgbr7dB" widgetaid="rBzDITSvJSPl" xmi.id="O1ZiTwRazT8j" type="500" linecolor="none" >
<linepath>
<startpoint startx="460" starty="430" />
<endpoint endx="270" endy="274" />
<startpoint startx="410" starty="430" />
<endpoint endx="310" endy="270" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="13WT2dgbr7dB" widgetaid="942XkzWxwv2Y" xmi.id="Auz9L5qlfV7A" type="500" linecolor="none" >
<linepath>
<startpoint startx="400" starty="230" />
<endpoint endx="311" endy="250" />
<startpoint startx="400" starty="250" />
<endpoint endx="310" endy="250" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="13WT2dgbr7dB" widgetaid="1mf1YAzNLxae" xmi.id="ODA3gFBrCnWk" type="500" linecolor="none" >
<linepath>
<startpoint startx="520" starty="124" />
<endpoint endx="270" endy="230" />
<startpoint startx="420" starty="120" />
<endpoint endx="310" endy="230" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="4" indexb="1" linewidth="none" widgetbid="rBzDITSvJSPl" widgetaid="AEVNz05t81LH" xmi.id="etb4Ag0Aogvd" type="500" linecolor="none" >
......@@ -196,7 +203,7 @@
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="4" indexb="2" linewidth="none" widgetbid="rBzDITSvJSPl" widgetaid="EkPJsQVClvZP" xmi.id="5kmsRfVoKOdt" type="500" linecolor="none" >
<linepath>
<startpoint startx="720" starty="500" />
<startpoint startx="720" starty="480" />
<endpoint endx="500" endy="470" />
</linepath>
</assocwidget>
......@@ -220,13 +227,13 @@
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="5" indexb="1" linewidth="none" widgetbid="942XkzWxwv2Y" widgetaid="GbPEOWwcfaTu" xmi.id="67K0uRAIyZ2y" type="500" linecolor="none" >
<linepath>
<startpoint startx="720" starty="150" />
<startpoint startx="720" starty="170" />
<endpoint endx="490" endy="210" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="5" indexb="3" linewidth="none" widgetbid="942XkzWxwv2Y" widgetaid="6hIcHyBenVkh" xmi.id="1xsxWutJGV0N" type="500" linecolor="none" >
<linepath>
<startpoint startx="720" starty="280" />
<startpoint startx="720" starty="260" />
<endpoint endx="490" endy="250" />
</linepath>
</assocwidget>
......@@ -242,6 +249,12 @@
<endpoint endx="490" endy="250" />
</linepath>
</assocwidget>
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="942XkzWxwv2Y" widgetaid="XQyb0Na5Qywe" xmi.id="jRmBg9Xtp3mB" type="500" linecolor="none" >
<linepath>
<startpoint startx="710" starty="70" />
<endpoint endx="490" endy="210" />
</linepath>
</assocwidget>
</associations>
</diagram>
</diagrams>
......@@ -263,7 +276,7 @@
</UML:Model>
</XMI.content>
<XMI.extensions xmi.extender="umbrello" >
<docsettings viewid="eM4mV4kVVzFl" documentation="" uniqueid="OnsyCaGWOwMK" />
<docsettings viewid="eM4mV4kVVzFl" documentation="" uniqueid="zFoNDizvAl6o" />
<listview>
<listitem open="1" type="800" label="Views" >
<listitem open="1" type="801" id="Logical View" >
......@@ -277,6 +290,7 @@
<listitem open="1" type="813" id="13WT2dgbr7dB" />
<listitem open="1" type="813" id="nwVvxqA9YXQO" />
<listitem open="1" type="813" id="1mf1YAzNLxae" />
<listitem open="1" type="813" id="XQyb0Na5Qywe" />
<listitem open="1" type="813" id="xvbgrA5ZWSEp" />
<listitem open="1" type="813" id="M0kFlWhnZCEb" />
<listitem open="1" type="813" id="6hIcHyBenVkh" />
......
......@@ -25,6 +25,9 @@ include_directories( ${KDE4_INCLUDE_DIR}/threadweaver/
set(kritaimage_LIB_SRCS
${libkritatile_SRCS}
kis_base_node.cpp
kis_node.cpp
kis_node_facade.cpp
kis_action_recorder.cc
kis_recorded_action.cc
kis_recorded_paint_actions.cc
......@@ -55,12 +58,10 @@ set(kritaimage_LIB_SRCS
kis_gradient_painter.cc
kis_histogram.cc
kis_image.cc
kis_imagepipe_brush.cc
kis_iterator.cc
kis_layer.cc
kis_group_layer.cc
kis_paint_layer.cc
kis_meta_registry.cc
kis_nameserver.cc
kis_paint_device.cc
kis_painter.cc
......@@ -85,7 +86,6 @@ set(kritaimage_LIB_SRCS
kis_perspective_math.cpp
kis_mask.cc
kis_effect_mask.cc
kis_image_view_converter.cpp
kis_image_commands.cc
kis_layer_commands.cc
kis_undo_adapter.cc
......@@ -93,9 +93,7 @@ set(kritaimage_LIB_SRCS
kis_clone_layer.cpp
kis_pixel_selection.cpp
kis_transparency_mask.cc
kis_base_node.cpp
kis_node.cpp
kis_node_facade.cpp
kis_selection_mask.cpp
metadata/kis_meta_data_store.cc
metadata/kis_meta_data_value.cc
metadata/kis_meta_data_schema.cc
......
......@@ -25,19 +25,30 @@
class KisRecordedAction;
/**
* XXX: dox?
*/
class KRITAIMAGE_EXPORT KisActionRecorder : public QObject {
Q_OBJECT
public:
KisActionRecorder();
~KisActionRecorder();
QList<KisRecordedAction*> actions() const;
public slots:
void addAction(KisRecordedAction* action);
signals:
void addedAction(KisRecordedAction* action);
private:
struct Private;
Private* const d;
public:
KisActionRecorder();
~KisActionRecorder();
QList<KisRecordedAction*> actions() const;
public slots:
void addAction(KisRecordedAction* action);
signals:
void addedAction(KisRecordedAction* action);
private:
struct Private;
Private* const d;
};
......
......@@ -36,36 +36,50 @@
#include "kis_filter_registry.h"
#include "kis_filter.h"
class KisAdjustmentLayer::Private
{
public:
bool showSelection;
KisFilterConfiguration * filterConfig;
KisSelectionSP selection;
KisSelectionSP selectionProjection;
KisPaintDeviceSP cachedPaintDevice;
};
KisAdjustmentLayer::KisAdjustmentLayer(KisImageSP img, const QString &name, KisFilterConfiguration * kfc, KisSelectionSP selection)
: KisLayer (img.data(), name, OPACITY_OPAQUE)
, m_d( new Private() )
{
m_filterConfig = kfc;
m_d->filterConfig = kfc;
setSelection( selection );
m_cachedPaintDev = new KisPaintDevice( img->colorSpace(), name.toLatin1());
m_showSelection = true;
Q_ASSERT(m_cachedPaintDev);
m_d->cachedPaintDevice = new KisPaintDevice( img->colorSpace(), name.toLatin1());
m_d->showSelection = true;
Q_ASSERT(m_d->cachedPaintDevice);
}
KisAdjustmentLayer::KisAdjustmentLayer(const KisAdjustmentLayer& rhs)
: KisLayer(rhs), KisIndirectPaintingSupport(rhs)
, m_d( new Private() )
{
m_filterConfig = new KisFilterConfiguration(*rhs.m_filterConfig);
if (rhs.m_selection) {
m_selection = new KisSelection( *rhs.m_selection.data() );
// m_selection->setParentLayer(this);
m_selection->setInterestedInDirtyness(true);