Krita Source Code Documentation
Loading...
Searching...
No Matches
KisPaintOpFactory Class Referenceabstract

#include <kis_paintop_factory.h>

+ Inheritance diagram for KisPaintOpFactory:

Public Types

enum  PaintopVisibility { AUTO , ALWAYS , NEVER }
 

Public Member Functions

virtual QString category () const =0
 
virtual KisPaintOpConfigWidgetcreateConfigWidget (QWidget *parent, KisResourcesInterfaceSP resourcesInterface, KoCanvasResourcesInterfaceSP canvasResourcesInterface)=0
 
virtual KisInterstrokeDataFactorycreateInterstrokeDataFactory (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface) const
 
virtual KisPaintOpcreateOp (const KisPaintOpSettingsSP settings, KisPainter *painter, KisNodeSP node, KisImageSP image)=0
 
virtual KisPaintOpSettingsSP createSettings (KisResourcesInterfaceSP resourcesInterface)=0
 
virtual QIcon icon ()
 icon
 
virtual QString id () const =0
 
 KisPaintOpFactory (const QStringList &whiteListedCompositeOps=QStringList())
 
virtual bool lodSizeThresholdSupported () const =0
 
virtual QString name () const =0
 
virtual QList< KoResourceLoadResultprepareEmbeddedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface)=0
 
virtual QList< KoResourceLoadResultprepareLinkedResources (const KisPaintOpSettingsSP settings, KisResourcesInterfaceSP resourcesInterface)=0
 
int priority () const
 
void setPriority (int newPriority)
 
QStringList whiteListedCompositeOps () const
 
 ~KisPaintOpFactory () override
 

Static Public Member Functions

static QString categoryStable ()
 

Private Attributes

int m_priority
 
PaintopVisibility m_visibility
 
QStringList m_whiteListedCompositeOps
 

Detailed Description

The paintop factory is responsible for creating paintops of the specified class. If there is an optionWidget, the derived paintop itself must support settings, and it's up to the factory to do that.

Definition at line 38 of file kis_paintop_factory.h.

Member Enumeration Documentation

◆ PaintopVisibility

Enumerator
AUTO 
ALWAYS 
NEVER 

Definition at line 44 of file kis_paintop_factory.h.

Constructor & Destructor Documentation

◆ KisPaintOpFactory()

KisPaintOpFactory::KisPaintOpFactory ( const QStringList & whiteListedCompositeOps = QStringList())
Parameters
whiteListedCompositeOpslist of compositeops that don't work with this paintop

Definition at line 11 of file kis_paintop_factory.cpp.

◆ ~KisPaintOpFactory()

KisPaintOpFactory::~KisPaintOpFactory ( )
inlineoverride

Definition at line 54 of file kis_paintop_factory.h.

54{}

Member Function Documentation

◆ category()

virtual QString KisPaintOpFactory::category ( ) const
pure virtual

◆ categoryStable()

QString KisPaintOpFactory::categoryStable ( )
static

Definition at line 36 of file kis_paintop_factory.cpp.

37{
38 return i18nc("Category of brush engines", "Brush engines");
39}

◆ createConfigWidget()

virtual KisPaintOpConfigWidget * KisPaintOpFactory::createConfigWidget ( QWidget * parent,
KisResourcesInterfaceSP resourcesInterface,
KoCanvasResourcesInterfaceSP canvasResourcesInterface )
pure virtual

create a widget that can display paintop settings

Implemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

◆ createInterstrokeDataFactory()

KisInterstrokeDataFactory * KisPaintOpFactory::createInterstrokeDataFactory ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface ) const
virtual

Reimplemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >.

Definition at line 41 of file kis_paintop_factory.cpp.

42{
43 return 0;
44}

◆ createOp()

virtual KisPaintOp * KisPaintOpFactory::createOp ( const KisPaintOpSettingsSP settings,
KisPainter * painter,
KisNodeSP node,
KisImageSP image )
pure virtual

Create a KisPaintOp with the given settings and painter.

Parameters
settingsthe settings associated with the input device
painterthe painter used to draw
nodethe node used to draw
imagethe image used to draw

Implemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

◆ createSettings()

virtual KisPaintOpSettingsSP KisPaintOpFactory::createSettings ( KisResourcesInterfaceSP resourcesInterface)
pure virtual

Create and return an settings object for this paintop.

Implemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

◆ icon()

QIcon KisPaintOpFactory::icon ( )
virtual

icon

Returns
the icon to represent this paintop.

Reimplemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

Definition at line 29 of file kis_paintop_factory.cpp.

30{
31 QPixmap p = QPixmap(22, 22);
32 p.fill(Qt::transparent);
33 return QIcon(p);
34}
const Params2D p

References p.

◆ id()

virtual QString KisPaintOpFactory::id ( ) const
pure virtual

◆ lodSizeThresholdSupported()

virtual bool KisPaintOpFactory::lodSizeThresholdSupported ( ) const
pure virtual

◆ name()

virtual QString KisPaintOpFactory::name ( ) const
pure virtual

◆ prepareEmbeddedResources()

virtual QList< KoResourceLoadResult > KisPaintOpFactory::prepareEmbeddedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface )
pure virtual
Returns
all the resources embedded into settings. The resources are first tried to be loaded from resourcesInterface, and, if it fails, loaded from the embedded data.

Implemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

◆ prepareLinkedResources()

virtual QList< KoResourceLoadResult > KisPaintOpFactory::prepareLinkedResources ( const KisPaintOpSettingsSP settings,
KisResourcesInterfaceSP resourcesInterface )
pure virtual
Returns
all the resources linked to settings.

Implemented in KisSimplePaintOpFactory< Op, OpSettings, OpSettingsWidget >, and KisMyPaintOpFactory.

◆ priority()

int KisPaintOpFactory::priority ( ) const

Definition at line 52 of file kis_paintop_factory.cpp.

53{
54 return m_priority;
55}

References m_priority.

◆ setPriority()

void KisPaintOpFactory::setPriority ( int newPriority)

Set the priority of this paintop, as it is shown in the UI; lower number means it will be show more to the front of the list.

Parameters
newPrioritythe priority

Definition at line 46 of file kis_paintop_factory.cpp.

47{
48 m_priority = newPriority;
49}

References m_priority.

◆ whiteListedCompositeOps()

QStringList KisPaintOpFactory::whiteListedCompositeOps ( ) const

List of usually hidden compositeops that are useful for this paintop.

Definition at line 17 of file kis_paintop_factory.cpp.

18{
20}

References m_whiteListedCompositeOps.

Member Data Documentation

◆ m_priority

int KisPaintOpFactory::m_priority
private

Definition at line 120 of file kis_paintop_factory.h.

◆ m_visibility

PaintopVisibility KisPaintOpFactory::m_visibility
private

Definition at line 121 of file kis_paintop_factory.h.

◆ m_whiteListedCompositeOps

QStringList KisPaintOpFactory::m_whiteListedCompositeOps
private

Definition at line 119 of file kis_paintop_factory.h.


The documentation for this class was generated from the following files: