Commit 534419dc authored by Cyrille Berger's avatar Cyrille Berger

force composite ops to have categories

svn path=/trunk/koffice/; revision=959414
parent b6ec5645
......@@ -42,7 +42,7 @@ class CompositeCopy : public KoCompositeOp {
public:
explicit CompositeCopy(KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_COPY, i18n("Copy" ) )
: KoCompositeOp(cs, COMPOSITE_COPY, i18n("Copy" ), KoCompositeOp::categoryMix() )
{
}
......
......@@ -22,6 +22,22 @@
#include "KoCompositeOp.h"
#include "KoColorSpace.h"
QString KoCompositeOp::categoryMix() {
return i18n("Mix");
}
QString KoCompositeOp::categoryLight() {
return i18n("Light");
}
QString KoCompositeOp::categoryArithmetic() {
return i18n("Arithmetic");
}
QString KoCompositeOp::categoryColor() {
return i18n("Color");
}
QString KoCompositeOp::categoryMisc() {
return i18n("Misc");
}
struct KoCompositeOp::Private {
const KoColorSpace * colorSpace;
QString id;
......@@ -49,6 +65,10 @@ KoCompositeOp::KoCompositeOp(const KoColorSpace * cs, const QString& id, const
d->description = description;
d->userVisible = userVisible;
d->category = category;
if(d->category.isEmpty())
{
d->category = categoryMisc();
}
}
void KoCompositeOp::composite(quint8 *dstRowStart, qint32 dstRowStride,
......
......@@ -67,6 +67,12 @@ const QString COMPOSITE_COPY_OPACITY = "copy_opacity";
* Base for colorspace-specific blending modes.
*/
class PIGMENTCMS_EXPORT KoCompositeOp {
public:
static QString categoryMix();
static QString categoryLight();
static QString categoryArithmetic();
static QString categoryColor();
static QString categoryMisc();
public:
/**
......@@ -77,7 +83,7 @@ public:
* @param userVisible define whether or not that composite op should be visible in an user
* interface
*/
KoCompositeOp(const KoColorSpace * cs, const QString& id, const QString& description, const QString & category = "", const bool userVisible = true);
KoCompositeOp(const KoColorSpace * cs, const QString& id, const QString& description, const QString & categoryMisc, const bool userVisible = true);
virtual ~KoCompositeOp();
/**
......
......@@ -40,7 +40,7 @@ namespace {
public:
CompositeOver(KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_OVER, i18n("Normal" ) )
: KoCompositeOp(cs, COMPOSITE_OVER, i18n("Normal" ), KoCompositeOp::categoryMix() )
{
}
......@@ -139,7 +139,7 @@ namespace {
public:
CompositeClear(KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_CLEAR, i18n("Clear" ) )
: KoCompositeOp(cs, COMPOSITE_CLEAR, i18n("Clear" ), KoCompositeOp::categoryMix() )
{
}
......@@ -214,7 +214,7 @@ namespace {
public:
CompositeErase(KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_ERASE, i18n("Erase" ) )
: KoCompositeOp(cs, COMPOSITE_ERASE, i18n("Erase" ), KoCompositeOp::categoryMix() )
{
}
......@@ -279,7 +279,7 @@ namespace {
public:
CompositeSubtract(KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_SUBSTRACT, i18n("Subtract" ) )
: KoCompositeOp(cs, COMPOSITE_SUBSTRACT, i18n("Subtract" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpAdd : public KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpA
public:
KoCompositeOpAdd(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpAdd<_CSTraits> >(cs, COMPOSITE_ADD, i18n("Add" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpAdd<_CSTraits> >(cs, COMPOSITE_ADD, i18n("Add" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -43,8 +43,8 @@ class KoCompositeOpAlphaBase : public KoCompositeOp {
typedef typename _CSTraits::channels_type channels_type;
public:
KoCompositeOpAlphaBase(const KoColorSpace * cs, const QString& id, const QString& description)
: KoCompositeOp(cs, id, description )
KoCompositeOpAlphaBase(const KoColorSpace * cs, const QString& id, const QString& description, const QString& category )
: KoCompositeOp(cs, id, description, category )
{
}
......
......@@ -37,7 +37,7 @@ class KoCompositeOpAlphaDarken : public KoCompositeOp {
public:
KoCompositeOpAlphaDarken(const KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_ALPHA_DARKEN, i18n("Alpha darken" ) )
: KoCompositeOp(cs, COMPOSITE_ALPHA_DARKEN, i18n("Alpha darken" ), KoCompositeOp::categoryMix() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpBurn : public KoCompositeOpAlphaBase<_CSTraits, KoCompositeOp
public:
KoCompositeOpBurn(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpBurn<_CSTraits> >(cs, COMPOSITE_BURN, i18n("Burn" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpBurn<_CSTraits> >(cs, COMPOSITE_BURN, i18n("Burn" ), KoCompositeOp::categoryLight() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpDivide : public KoCompositeOpAlphaBase<_CSTraits, KoComposite
public:
KoCompositeOpDivide(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpDivide<_CSTraits> >(cs, COMPOSITE_DIVIDE, i18n("Divide" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpDivide<_CSTraits> >(cs, COMPOSITE_DIVIDE, i18n("Divide" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -33,7 +33,7 @@ class KoCompositeOpDodge : public KoCompositeOpAlphaBase<_CSTraits, KoCompositeO
public:
KoCompositeOpDodge(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpDodge<_CSTraits> >(cs, COMPOSITE_DODGE, i18n("Dodge" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpDodge<_CSTraits> >(cs, COMPOSITE_DODGE, i18n("Dodge" ), KoCompositeOp::categoryLight() )
{
}
......
......@@ -36,7 +36,7 @@ class KoCompositeOpErase : public KoCompositeOp {
public:
KoCompositeOpErase(const KoColorSpace * cs)
: KoCompositeOp(cs, COMPOSITE_ERASE, i18n("Erase" ) )
: KoCompositeOp(cs, COMPOSITE_ERASE, i18n("Erase" ), KoCompositeOp::categoryMix() )
{
}
......
......@@ -31,7 +31,7 @@ class KoCompositeOpMultiply : public KoCompositeOpAlphaBase<_CSTraits, KoComposi
public:
KoCompositeOpMultiply(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpMultiply<_CSTraits> >(cs, COMPOSITE_MULT, i18n("Multiply" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpMultiply<_CSTraits> >(cs, COMPOSITE_MULT, i18n("Multiply" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpOver : public KoCompositeOpAlphaBase<_CSTraits, KoCompositeOp
public:
KoCompositeOpOver(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOver<_CSTraits> >(cs, COMPOSITE_OVER, i18n("Normal" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOver<_CSTraits> >(cs, COMPOSITE_OVER, i18n("Normal" ), KoCompositeOp::categoryMix() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpOverlay : public KoCompositeOpAlphaBase<_CSTraits, KoComposit
public:
KoCompositeOpOverlay(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOverlay<_CSTraits> >(cs, COMPOSITE_OVERLAY, i18n("Overlay" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpOverlay<_CSTraits> >(cs, COMPOSITE_OVERLAY, i18n("Overlay" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpScreen : public KoCompositeOpAlphaBase<_CSTraits, KoComposite
public:
KoCompositeOpScreen(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpScreen<_CSTraits> >(cs, COMPOSITE_SCREEN, i18n("Screen" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpScreen<_CSTraits> >(cs, COMPOSITE_SCREEN, i18n("Screen" ), KoCompositeOp::categoryArithmetic() )
{
}
......
......@@ -32,7 +32,7 @@ class KoCompositeOpSubstract : public KoCompositeOpAlphaBase<_CSTraits, KoCompos
public:
KoCompositeOpSubstract(const KoColorSpace * cs)
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpSubstract<_CSTraits> >(cs, COMPOSITE_SUBSTRACT, i18n("Subtract" ) )
: KoCompositeOpAlphaBase<_CSTraits, KoCompositeOpSubstract<_CSTraits> >(cs, COMPOSITE_SUBSTRACT, i18n("Subtract" ), KoCompositeOp::categoryArithmetic() )
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment