[calligra/krita-chili-kazakov] krita/plugins/paintops: Add a skeleton stacked brush paintop

Lukast dev lukast.dev at gmail.com
Wed May 27 20:35:06 UTC 2015


Hello boud and dmitryK,

have you considered to realize the stacked brush through multihand tool?
One would have to create UI for selecting brush preset for every KisPainter
in multihand tool.
Then it is just a matter of transformation, for stacking two brushes you
would use identity transformation.

Advantages:
- useful with any brush engine
- it would be possible to stack n brushes
- new possibilities: mirroring or symetry or with different brush engines

Why paintop?

Lukas

2015-05-27 13:02 GMT+02:00 Boudewijn Rempt <boud at valdyas.org>:

> Git commit f29dbf00eaf2014904dcd80ee741b8e8f96d5b51 by Boudewijn Rempt.
> Committed on 27/05/2015 at 11:01.
> Pushed by rempt into branch 'krita-chili-kazakov'.
>
> Add a skeleton stacked brush paintop
>
> For Dmitry to add gui and logic to :-)
>
> M  +1    -0    krita/plugins/paintops/CMakeLists.txt
> A  +23   -0    krita/plugins/paintops/stacked/CMakeLists.txt
> A  +-    --    krita/plugins/paintops/stacked/krita-stacked.png
> A  +35   -0    krita/plugins/paintops/stacked/stacked_brush.cpp
>  [License: LGPL (v2+)]
> A  +38   -0    krita/plugins/paintops/stacked/stacked_brush.h
>  [License: LGPL (v2+)]
> A  +43   -0    krita/plugins/paintops/stacked/stacked_paintop.cpp
>  [License: LGPL (v2+)]
> A  +45   -0    krita/plugins/paintops/stacked/stacked_paintop.h
>  [License: LGPL (v2+)]
> A  +53   -0    krita/plugins/paintops/stacked/stacked_paintop_plugin.cpp
>    [License: LGPL (v2+)]
> A  +37   -0    krita/plugins/paintops/stacked/stacked_paintop_plugin.h
>  [License: LGPL (v2+)]
> A  +48   -0
> krita/plugins/paintops/stacked/stacked_paintop_settings.cpp     [License:
> LGPL (v2+)]
> A  +40   -0    krita/plugins/paintops/stacked/stacked_paintop_settings.h
>    [License: LGPL (v2+)]
> A  +54   -0
> krita/plugins/paintops/stacked/stacked_paintop_settings_widget.cpp
>  [License: LGPL (v2+)]
> A  +47   -0
> krita/plugins/paintops/stacked/stacked_paintop_settings_widget.h
>  [License: LGPL (v2+)]
> A  +56   -0    krita/plugins/paintops/stacked/stackedop_option.cpp
>  [License: GPL (v2+)]
> A  +42   -0    krita/plugins/paintops/stacked/stackedop_option.h
>  [License: GPL (v2+)]
> A  +43   -0    krita/plugins/paintops/stacked/stackedpaintop.desktop
> A  +40   -0    krita/plugins/paintops/stacked/wdgstackedoptions.ui
>
> http://commits.kde.org/calligra/f29dbf00eaf2014904dcd80ee741b8e8f96d5b51
>
> diff --git a/krita/plugins/paintops/CMakeLists.txt
> b/krita/plugins/paintops/CMakeLists.txt
> index baff8c2..fab2d11 100644
> --- a/krita/plugins/paintops/CMakeLists.txt
> +++ b/krita/plugins/paintops/CMakeLists.txt
> @@ -16,3 +16,4 @@ add_subdirectory( gridbrush )
>  add_subdirectory( hatching)
>  add_subdirectory( sketch )
>  add_subdirectory( colorsmudge )
> +add_subdirectory( stacked )
> diff --git a/krita/plugins/paintops/stacked/CMakeLists.txt
> b/krita/plugins/paintops/stacked/CMakeLists.txt
> new file mode 100644
> index 0000000..5b7b102
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/CMakeLists.txt
> @@ -0,0 +1,23 @@
> +set(kritastackedpaintop_PART_SRCS
> +    stacked_paintop_plugin.cpp
> +    stacked_paintop_settings.cpp
> +    stacked_paintop_settings_widget.cpp
> +    stacked_brush.cpp
> +    stacked_paintop.cpp
> +    stackedop_option.cpp
> +)
> +
> +kde4_add_ui_files(kritastackedpaintop_PART_SRCS wdgstackedoptions.ui )
> +
> +kde4_add_plugin(kritastackedpaintop ${kritastackedpaintop_PART_SRCS})
> +
> +
> +target_link_libraries(kritastackedpaintop  kritaui kritalibpaintop
> kritalibbrush kowidgetutils)
> +
> +install(TARGETS kritastackedpaintop  DESTINATION ${PLUGIN_INSTALL_DIR})
> +
> +########### install files ###############
> +
> +install( FILES  kritastackedpaintop.desktop  DESTINATION
> ${SERVICES_INSTALL_DIR}/calligra)
> +install( FILES
> +    krita-stacked.png DESTINATION ${DATA_INSTALL_DIR}/krita/images)
> diff --git a/krita/plugins/paintops/stacked/krita-stacked.png
> b/krita/plugins/paintops/stacked/krita-stacked.png
> new file mode 100644
> index 0000000..fd4d0fa
> Binary files /dev/null and
> b/krita/plugins/paintops/stacked/krita-stacked.png differ
> diff --git a/krita/plugins/paintops/stacked/stacked_brush.cpp
> b/krita/plugins/paintops/stacked/stacked_brush.cpp
> new file mode 100644
> index 0000000..dff0476
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_brush.cpp
> @@ -0,0 +1,35 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#include "stacked_brush.h"
> +
> +
> +StackedBrush::StackedBrush()
> +{
> +}
> +
> +
> +StackedBrush::~StackedBrush()
> +{
> +}
> +
> +
> +void StackedBrush::paint(KisPaintDeviceSP dev, qreal x, qreal y, const
> KoColor &color)
> +{
> +}
> +
> diff --git a/krita/plugins/paintops/stacked/stacked_brush.h
> b/krita/plugins/paintops/stacked/stacked_brush.h
> new file mode 100644
> index 0000000..0941d4b
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_brush.h
> @@ -0,0 +1,38 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#ifndef STACKED_BRUSH_H_
> +#define STACKED_BRUSH_H_
> +
> +#include <QVector>
> +
> +#include <KoColor.h>
> +
> +#include "kis_paint_device.h"
> +
> +class StackedBrush
> +{
> +
> +public:
> +    StackedBrush();
> +    ~StackedBrush();
> +    void paint(KisPaintDeviceSP dev, qreal x, qreal y, const KoColor
> &color);
> +
> +};
> +
> +#endif
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop.cpp
> b/krita/plugins/paintops/stacked/stacked_paintop.cpp
> new file mode 100644
> index 0000000..2675aac
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop.cpp
> @@ -0,0 +1,43 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#include "stacked_paintop.h"
> +#include "stacked_paintop_settings.h"
> +
> +StackedPaintOp::StackedPaintOp(const StackedPaintOpSettings *settings,
> KisPainter * painter, KisNodeSP node, KisImageSP image)
> +    : KisPaintOp(painter)
> +{
> +    Q_UNUSED(settings);
> +    Q_UNUSED(painter);
> +    Q_UNUSED(node);
> +    Q_UNUSED(image);
> +
> +    m_stackedBrush = new StackedBrush();
> +}
> +
> +StackedPaintOp::~StackedPaintOp()
> +{
> +    delete m_stackedBrush;
> +}
> +
> +KisSpacingInformation StackedPaintOp::paintAt(const KisPaintInformation&
> info)
> +{
> +    if (!painter()) return KisSpacingInformation(1.0);
> +
> +    return KisSpacingInformation(1.0);
> +}
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop.h
> b/krita/plugins/paintops/stacked/stacked_paintop.h
> new file mode 100644
> index 0000000..a81ba8d
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop.h
> @@ -0,0 +1,45 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#ifndef KIS_STACKED_PAINTOP_H_
> +#define KIS_STACKED_PAINTOP_H_
> +
> +#include <kis_paintop.h>
> +#include <kis_types.h>
> +
> +#include "stacked_brush.h"
> +#include "stacked_paintop_settings.h"
> +
> +class KisPainter;
> +
> +class StackedPaintOp : public KisPaintOp
> +{
> +
> +public:
> +
> +    StackedPaintOp(const StackedPaintOpSettings *settings, KisPainter *
> painter, KisNodeSP node, KisImageSP image);
> +    virtual ~StackedPaintOp();
> +
> +    KisSpacingInformation paintAt(const KisPaintInformation& info);
> +
> +private:
> +
> +    StackedBrush *m_stackedBrush;
> +};
> +
> +#endif // KIS_STACKED_PAINTOP_H_
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop_plugin.cpp
> b/krita/plugins/paintops/stacked/stacked_paintop_plugin.cpp
> new file mode 100644
> index 0000000..df52ea9
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_plugin.cpp
> @@ -0,0 +1,53 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#include "stacked_paintop_plugin.h"
> +
> +
> +#include <klocale.h>
> +
> +#include <kis_debug.h>
> +#include <kpluginfactory.h>
> +
> +#include <kis_paintop_registry.h>
> +#include "kis_simple_paintop_factory.h"
> +
> +#include "stacked_paintop.h"
> +#include "stacked_paintop_settings_widget.h"
> +#include "stacked_paintop_settings.h"
> +#include "stacked_paintop_settings.h"
> +
> +#include "kis_global.h"
> +
> +K_PLUGIN_FACTORY(StackedPaintOpPluginFactory,
> registerPlugin<StackedPaintOpPlugin>();)
> +K_EXPORT_PLUGIN(StackedPaintOpPluginFactory("krita"))
> +
> +
> +StackedPaintOpPlugin::StackedPaintOpPlugin(QObject *parent, const
> QVariantList &)
> +    : QObject(parent)
> +{
> +    KisPaintOpRegistry *r = KisPaintOpRegistry::instance();
> +    r->add(new KisSimplePaintOpFactory<StackedPaintOp,
> StackedPaintOpSettings, StackedPaintOpSettingsWidget>("stackedbrush",
> i18n("Stacked Brush"),
> +            KisPaintOpFactory::categoryStable(), "krita-stacked.png"));
> +}
> +
> +StackedPaintOpPlugin::~StackedPaintOpPlugin()
> +{
> +}
> +
> +#include "stacked_paintop_plugin.moc"
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop_plugin.h
> b/krita/plugins/paintops/stacked/stacked_paintop_plugin.h
> new file mode 100644
> index 0000000..392fcff
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_plugin.h
> @@ -0,0 +1,37 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#ifndef STACKED_PAINTOP_PLUGIN_H_
> +#define STACKED_PAINTOP_PLUGIN_H_
> +
> +#include <QObject>
> +#include <QVariant>
> +
> +
> +/**
> + * A plugin wrapper that adds the paintop factories to the paintop
> registry.
> + */
> +class StackedPaintOpPlugin : public QObject
> +{
> +    Q_OBJECT
> +public:
> +    StackedPaintOpPlugin(QObject *parent, const QVariantList &);
> +    virtual ~StackedPaintOpPlugin();
> +};
> +
> +#endif // STACKED_PAINTOP_PLUGIN_H_
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop_settings.cpp
> b/krita/plugins/paintops/stacked/stacked_paintop_settings.cpp
> new file mode 100644
> index 0000000..d67d6db
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_settings.cpp
> @@ -0,0 +1,48 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#include "stacked_paintop_settings.h"
> +
> +#include <stackedop_option.h>
> +
> +#include <kis_paint_action_type_option.h>
> +#include <kis_airbrush_option.h>
> +
> +StackedPaintOpSettings::StackedPaintOpSettings()
> +{
> +}
> +
> +bool StackedPaintOpSettings::paintIncremental()
> +{
> +    return (enumPaintActionType)getInt("PaintOpAction", WASH) == BUILDUP;
> +}
> +
> +bool StackedPaintOpSettings::isAirbrushing() const
> +{
> +    return false;
> +}
> +
> +int StackedPaintOpSettings::rate() const
> +{
> +    return 0;
> +}
> +
> +QPainterPath StackedPaintOpSettings::brushOutline(const
> KisPaintInformation &info, OutlineMode mode) const
> +{
> +    return QPainterPath();
> +}
> diff --git a/krita/plugins/paintops/stacked/stacked_paintop_settings.h
> b/krita/plugins/paintops/stacked/stacked_paintop_settings.h
> new file mode 100644
> index 0000000..e6ae35f
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_settings.h
> @@ -0,0 +1,40 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#ifndef KIS_STACKED_PAINTOP_SETTINGS_H_
> +#define KIS_STACKED_PAINTOP_SETTINGS_H_
> +
> +#include <kis_paintop_settings.h>
> +#include <kis_types.h>
> +
> +class StackedPaintOpSettings : public KisPaintOpSettings
> +{
> +
> +public:
> +    StackedPaintOpSettings();
> +    virtual ~StackedPaintOpSettings() {}
> +
> +    QPainterPath brushOutline(const KisPaintInformation &info,
> OutlineMode mode) const;
> +
> +    bool paintIncremental();
> +    bool isAirbrushing() const;
> +    int rate() const;
> +
> +};
> +
> +#endif
> diff --git
> a/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.cpp
> b/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.cpp
> new file mode 100644
> index 0000000..00cd970
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.cpp
> @@ -0,0 +1,54 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#include "stacked_paintop_settings_widget.h"
> +
> +#include <kis_paint_action_type_option.h>
> +
> +#include "stacked_paintop_settings.h"
> +#include "stackedop_option.h"
> +
> +StackedPaintOpSettingsWidget:: StackedPaintOpSettingsWidget(QWidget*
> parent)
> +    : KisPaintOpSettingsWidget(parent)
> +{
> +    m_stackedOption = new StackedOpOption();
> +    addPaintOpOption(m_stackedOption, i18n("Brush size"));
> +    addPaintOpOption(new KisPaintActionTypeOption(), i18n("Painting
> Mode"));
> +}
> +
> +StackedPaintOpSettingsWidget::~ StackedPaintOpSettingsWidget()
> +{
> +}
> +
> +KisPropertiesConfiguration*
> StackedPaintOpSettingsWidget::configuration() const
> +{
> +    StackedPaintOpSettings* config = new StackedPaintOpSettings();
> +
> config->setOptionsWidget(const_cast<StackedPaintOpSettingsWidget*>(this));
> +    config->setProperty("paintop", "stackedbrush"); // XXX: make this a
> const id string
> +    writeConfiguration(config);
> +    return config;
> +}
> +
> +void StackedPaintOpSettingsWidget::changePaintOpSize(qreal x, qreal y)
> +{
> +}
> +
> +QSizeF StackedPaintOpSettingsWidget::paintOpSize() const
> +{
> +    return QSizeF(10, 10);
> +}
> diff --git
> a/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.h
> b/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.h
> new file mode 100644
> index 0000000..9b0a39e
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stacked_paintop_settings_widget.h
> @@ -0,0 +1,47 @@
> +/*
> + *  Copyright (c) 2015 Boudewijn Rempt <boud at valdyas.org>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public
> License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.
> + */
> +#ifndef KIS_STACKEDPAINTOP_SETTINGS_WIDGET_H_
> +#define KIS_STACKEDPAINTOP_SETTINGS_WIDGET_H_
> +
> +#include <kis_paintop_settings_widget.h>
> +
> +#include "ui_wdgstackedoptions.h"
> +
> +class StackedOpOption;
> +
> +class StackedPaintOpSettingsWidget : public KisPaintOpSettingsWidget
> +{
> +    Q_OBJECT
> +
> +public:
> +    StackedPaintOpSettingsWidget(QWidget* parent = 0);
> +    virtual ~StackedPaintOpSettingsWidget();
> +
> +    KisPropertiesConfiguration* configuration() const;
> +
> +    ///Reimplemented
> +    void changePaintOpSize(qreal x, qreal y);
> +    virtual QSizeF paintOpSize() const;
> +private:
> +
> +    StackedOpOption *m_stackedOption;
> +
> +};
> +
> +#endif
> diff --git a/krita/plugins/paintops/stacked/stackedop_option.cpp
> b/krita/plugins/paintops/stacked/stackedop_option.cpp
> new file mode 100644
> index 0000000..17e5280
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stackedop_option.cpp
> @@ -0,0 +1,56 @@
> +/*
> + *  Copyright (c) 2008,2010 Lukáš Tvrdý <lukast.dev at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301, USA.
> + */
> +#include "stackedop_option.h"
> +
> +#include "ui_wdgstackedoptions.h"
> +
> +class StackedOpOptionsWidget: public QWidget, public Ui::WdgStackedOptions
> +{
> +public:
> +    StackedOpOptionsWidget(QWidget *parent = 0)
> +        : QWidget(parent) {
> +        setupUi(this);
> +    }
> +};
> +
> +StackedOpOption::StackedOpOption()
> +    : KisPaintOpOption(KisPaintOpOption::GENERAL, false)
> +{
> +    m_checkable = false;
> +    m_options = new StackedOpOptionsWidget();
> +    m_options->hide();
> +
> +    setObjectName("StackedOpOption");
> +
> +    setConfigurationPage(m_options);
> +}
> +
> +StackedOpOption::~StackedOpOption()
> +{
> +    // delete m_options;
> +}
> +
> +void StackedOpOption::writeOptionSetting(KisPropertiesConfiguration*
> setting) const
> +{
> +}
> +
> +void StackedOpOption::readOptionSetting(const KisPropertiesConfiguration*
> setting)
> +{
> +}
> +
> +
> diff --git a/krita/plugins/paintops/stacked/stackedop_option.h
> b/krita/plugins/paintops/stacked/stackedop_option.h
> new file mode 100644
> index 0000000..f7a63dd
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stackedop_option.h
> @@ -0,0 +1,42 @@
> +/*
> + *  Copyright (c) 2008,2010 Lukáš Tvrdý <lukast.dev at gmail.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301, USA.
> + */
> +#ifndef KIS_STACKEDOP_OPTION_H
> +#define KIS_STACKEDOP_OPTION_H
> +
> +#include <kis_paintop_option.h>
> +#include <krita_export.h>
> +
> +class StackedOpOptionsWidget;
> +
> +
> +class StackedOpOption : public KisPaintOpOption
> +{
> +public:
> +    StackedOpOption();
> +    ~StackedOpOption();
> +
> +    void writeOptionSetting(KisPropertiesConfiguration* setting) const;
> +    void readOptionSetting(const KisPropertiesConfiguration* setting);
> +
> +private:
> +
> +    StackedOpOptionsWidget * m_options;
> +
> +};
> +
> +#endif
> diff --git a/krita/plugins/paintops/stacked/stackedpaintop.desktop
> b/krita/plugins/paintops/stacked/stackedpaintop.desktop
> new file mode 100644
> index 0000000..672a602
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/stackedpaintop.desktop
> @@ -0,0 +1,43 @@
> +[Desktop Entry]
> +Name=Stacked brush
> +Name[bs]=Četka u obliku krede
> +Name[ca]=Pinzell de guix
> +Name[ca at valencia]=Pinzell de guix
> +Name[cs]=Křídový štětec
> +Name[da]=Kridtpensel
> +Name[de]=Kreidepinsel
> +Name[el]=Πινέλο κιμωλίας
> +Name[en_GB]=Stacked brush
> +Name[es]=Pincel de tiza
> +Name[et]=Kriidipintsel
> +Name[eu]=Klera-pintzela
> +Name[fi]=Liitusivellin
> +Name[fr]=Brosse craie
> +Name[gl]=Pincel de xiz
> +Name[hne]=चाक ब्रस
> +Name[hu]=Kréta
> +Name[it]=Pennello a gesso
> +Name[ja]=チョークブラシ
> +Name[kk]=Бор қылқаламы
> +Name[ko]=분필 브러시
> +Name[lt]=Kreidos teptukas
> +Name[lv]=Krīta ota
> +Name[mr]=खडू कुंचला
> +Name[nb]=Krittpensel
> +Name[nds]=Kriedpinsel
> +Name[nl]=Krijt-penseel
> +Name[pl]=Pędzel kredowy
> +Name[pt]=Pincel de carvão
> +Name[pt_BR]=Pincel de giz
> +Name[ru]=Мелок
> +Name[sk]=Kriedový štetec
> +Name[sv]=Kritpensel
> +Name[tr]=Tebeşir fırçası
> +Name[uk]=Крейдяний пензель
> +Name[wa]=Croye
> +Name[x-test]=xxStacked brushxx
> +Name[zh_TW]=粉筆刷
> +X-KDE-ServiceTypes=Krita/Paintop
> +Type=Service
> +X-KDE-Library=kritastackedpaintop
> +X-Krita-Version=28
> diff --git a/krita/plugins/paintops/stacked/wdgstackedoptions.ui
> b/krita/plugins/paintops/stacked/wdgstackedoptions.ui
> new file mode 100644
> index 0000000..d6e80ad
> --- /dev/null
> +++ b/krita/plugins/paintops/stacked/wdgstackedoptions.ui
> @@ -0,0 +1,40 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<ui version="4.0">
> + <class>WdgStackedOptions</class>
> + <widget class="QWidget" name="WdgStackedOptions">
> +  <property name="geometry">
> +   <rect>
> +    <x>0</x>
> +    <y>0</y>
> +    <width>330</width>
> +    <height>192</height>
> +   </rect>
> +  </property>
> +  <property name="sizePolicy">
> +   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
> +    <horstretch>210</horstretch>
> +    <verstretch>60</verstretch>
> +   </sizepolicy>
> +  </property>
> +  <property name="minimumSize">
> +   <size>
> +    <width>330</width>
> +    <height>60</height>
> +   </size>
> +  </property>
> +  <layout class="QGridLayout" name="gridLayout">
> +   <item row="0" column="0">
> +    <widget class="QLabel" name="label">
> +     <property name="text">
> +      <string>Stacked Brush!!!</string>
> +     </property>
> +     <property name="alignment">
> +      <set>Qt::AlignCenter</set>
> +     </property>
> +    </widget>
> +   </item>
> +  </layout>
> + </widget>
> + <resources/>
> + <connections/>
> +</ui>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20150527/b14d0098/attachment-0001.html>


More information about the kimageshop mailing list