9#include <QStandardPaths>
12#include <QApplication>
16#include <QKeySequence>
125 const QString &defaultName,
210 Q_ASSERT(shapeController);
211 shapeController->disconnect(SIGNAL(sigActivateNode(
KisNodeSP)),
this);
220 Q_ASSERT(shapeController);
258#define NEW_LAYER_ACTION(id, layerType) \
260 action = actionManager->createAction(id); \
261 m_d->nodeCreationSignalMapper.setMapping(action, layerType); \
262 connect(action, SIGNAL(triggered()), \
263 &m_d->nodeCreationSignalMapper, SLOT(map())); \
266#define CONVERT_NODE_ACTION_2(id, layerType, exclude) \
268 action = actionManager->createAction(id); \
269 action->setExcludedNodeTypes(QStringList(exclude)); \
270 actionManager->addAction(id, action); \
271 m_d->nodeConversionSignalMapper.setMapping(action, layerType); \
272 connect(action, SIGNAL(triggered()), \
273 &m_d->nodeConversionSignalMapper, SLOT(map())); \
276#define CONVERT_NODE_ACTION(id, layerType) \
277 CONVERT_NODE_ACTION_2(id, layerType, layerType)
287 connect(action, SIGNAL(triggered()),
this, SLOT(
mirrorNodeX()));
290 connect(action, SIGNAL(triggered()),
this, SLOT(
mirrorNodeY()));
292 action = actionManager->
createAction(
"mirrorAllNodesX");
295 action = actionManager->
createAction(
"mirrorAllNodesY");
298 action = actionManager->
createAction(
"activateNextLayer");
301 action = actionManager->
createAction(
"activateNextSiblingLayer");
304 action = actionManager->
createAction(
"activatePreviousLayer");
307 action = actionManager->
createAction(
"activatePreviousSiblingLayer");
310 action = actionManager->
createAction(
"switchToPreviouslyActiveNode");
313 action = actionManager->
createAction(
"save_node_as_image");
316 action = actionManager->
createAction(
"save_vector_node_to_svg");
323 action = actionManager->
createAction(
"copy_layer_clipboard");
326 action = actionManager->
createAction(
"cut_layer_clipboard");
329 action = actionManager->
createAction(
"paste_layer_from_clipboard");
332 action = actionManager->
createAction(
"create_quick_group");
335 action = actionManager->
createAction(
"create_quick_clipping_group");
339 connect(action, SIGNAL(triggered()),
this, SLOT(
quickUngroup()));
341 action = actionManager->
createAction(
"select_all_layers");
342 connect(action, SIGNAL(triggered()),
this, SLOT(
selectAllNodes()));
344 action = actionManager->
createAction(
"select_visible_layers");
347 action = actionManager->
createAction(
"select_locked_layers");
350 action = actionManager->
createAction(
"select_invisible_layers");
353 action = actionManager->
createAction(
"select_unlocked_layers");
356 action = actionManager->
createAction(
"new_from_visible");
359 action = actionManager->
createAction(
"create_reference_image_from_active_layer");
362 action = actionManager->
createAction(
"create_reference_image_from_visible_canvas");
365 action = actionManager->
createAction(
"pin_to_timeline");
366 action->setCheckable(
true);
389 NEW_LAYER_ACTION(
"add_new_fast_color_overlay_mask",
"FastColorOverlayFilterMask");
415 action = actionManager->
createAction(
"isolate_active_layer");
417 action = actionManager->
createAction(
"isolate_active_group");
421 action = actionManager->
createAction(
"toggle_layer_visibility");
424 action = actionManager->
createAction(
"toggle_layer_lock");
425 connect(action, SIGNAL(triggered()),
this, SLOT(
toggleLock()));
427 action = actionManager->
createAction(
"toggle_layer_inherit_alpha");
430 action = actionManager->
createAction(
"toggle_layer_alpha_lock");
433 action = actionManager->
createAction(
"split_alpha_into_mask");
436 action = actionManager->
createAction(
"split_alpha_write");
440 action = actionManager->
createAction(
"split_alpha_save_merged");
487 if (lockedNode && showWarning) {
488 QString errorMessage;
490 if (nodes.size() <= 1) {
491 errorMessage = i18n(
"Layer is locked");
493 errorMessage = i18n(
"Layer \"%1\" is locked", lockedNode->
name());
512 lockedNode = node->
parent();
517 if (lockedNode && showWarning) {
518 QString errorMessage = i18n(
"Layer \"%1\" is locked", lockedNode->
name());
532 if (parent->allowAsChild(node)) {
533 if (node->inherits(
"KisSelectionMask") && parent->inherits(
"KisLayer")) {
535 KisLayer *l = qobject_cast<KisLayer*>(parent.data());
548 juggler->
moveNode(nodes, parent, aboveThis);
555 juggler->
copyNode(nodes, parent, aboveThis);
562 juggler->
addNode(nodes, parent, aboveThis);
595 if (isolateActiveLayer || isolateActiveGroup) {
607 if (!image || !isolationRoot)
return;
613 if (image->
startIsolatedMode(isolationRoot, isIsolatingLayer, isIsolatingGroup) ==
false) {
662 }
else if (
nodeType ==
"KisGroupLayer") {
664 }
else if (
nodeType ==
"KisAdjustmentLayer") {
666 }
else if (
nodeType ==
"KisGeneratorLayer") {
668 }
else if (
nodeType ==
"KisShapeLayer") {
670 }
else if (
nodeType ==
"KisCloneLayer") {
672 if (nodes.isEmpty()) {
676 }
else if (
nodeType ==
"KisTransparencyMask") {
678 }
else if (
nodeType ==
"KisFilterMask") {
680 }
else if (
nodeType ==
"FastColorOverlayFilterMask") {
682 }
else if (
nodeType ==
"KisColorizeMask") {
684 }
else if (
nodeType ==
"KisTransformMask") {
686 }
else if (
nodeType ==
"KisSelectionMask") {
688 }
else if (
nodeType ==
"KisFileLayer") {
719 if (!activeNode)
return;
725 }
else if (
nodeType ==
"KisSelectionMask" ||
727 nodeType ==
"KisTransparencyMask") {
736 if (
nodeType ==
"KisSelectionMask") {
738 }
else if (
nodeType ==
"KisFilterMask") {
740 }
else if (
nodeType ==
"KisTransparencyMask") {
750 }
else if (
nodeType ==
"KisFileLayer") {
769 if (document->referenceImagesLayer()) {
770 reference->setZIndex(document->referenceImagesLayer()->shapes().size());
778 QString strMessage = fromLayer ? i18nc(
"error dialog from the reference tool",
"Could not create a reference image from the active layer.")
779 : i18nc(
"error dialog from the reference tool",
"Could not create a reference image from the visible canvas.");
850 <<
"KarbonGradientTool"
851 <<
"KarbonCalligraphyTool"
855 <<
"KritaShape/KisToolBrush"
856 <<
"KritaShape/KisToolDyna"
857 <<
"KritaShape/KisToolMultiBrush"
858 <<
"KritaFill/KisToolFill"
859 <<
"KritaFill/KisToolGradient";
862 const bool nodeHasVectorAbilities = node->inherits(
"KisShapeLayer") ||
865 if (nodeHasVectorAbilities) {
908 if ((
selectedNodes().size() > 1 && node->inherits(
"KisLayer")) || node->inherits(
"KisLayer")) {
911 else if (node->inherits(
"KisMask")) {
924 if (node->inherits(
"KisLayer")) {
927 else if (node->inherits(
"KisMask")) {
946 return qMin(255,
int(opacity * 2.55 + 0.5));
952 if (node->
name() == name)
return;
961 if (node->
opacity() == opacity)
return;
1031 if (properties.contains(onionSkinOn)) {
1102 if (!node || !node->
parent()) {
1130 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1131 commandName =
kundo2_i18n(
"Mirror Mask Horizontally");
1134 commandName =
kundo2_i18np(
"Mirror Layer Horizontally",
"Mirror %1 Layers Horizontally", nodes.size());
1144 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1145 commandName =
kundo2_i18n(
"Mirror Mask Vertically");
1148 commandName =
kundo2_i18np(
"Mirror Layer Vertically",
"Mirror %1 Layers Vertically", nodes.size());
1170 if (!activeNode)
return;
1174 if (!siblingsOnly) {
1176 while (nextNode && nextNode->
childCount() > 0) {
1192 if (nextNode && nextNode->
parent()) {
1205 if (!activeNode)
return;
1209 if (!siblingsOnly) {
1227 if (nextNode && nextNode->
parent()) {
1246 Qt::Orientation orientation,
1250 mirrorNodes(nodes, actionName, orientation, selection);
1255 Qt::Orientation orientation,
1266 emitSignals, actionName);
1288 const QString &defaultName,
1295 dialog.setCaption(i18n(
"Export \"%1\"", defaultName));
1296 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1298 QString filename = dialog.filename();
1300 if (filename.isEmpty())
return;
1312 doc->setCurrentImage(dst);
1319 if (!doc->exportDocumentSync(filename, mimefilter.toLatin1())) {
1320 QMessageBox::warning(qApp->activeWindow(),
1321 i18nc(
"@title:window",
"Krita"),
1322 i18n(
"Could not save the layer. %1", doc->errorMessage().toUtf8().data()),
1333 warnKrita <<
"BUG: Save Node As Image was called without any node selected";
1340 m_d->
view->
showFloatingMessage(i18nc(
"warning message when trying to export a transform mask",
"Layer has no pixel data"), QIcon());
1364 dialog.setCaption(i18nc(
"@title:window",
"Export to SVG"));
1365 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1366 dialog.setMimeTypeFilters(
QStringList() <<
"image/svg+xml",
"image/svg+xml");
1367 QString filename = dialog.filename();
1369 if (filename.isEmpty())
return;
1371 QUrl url = QUrl::fromLocalFile(filename);
1373 if (url.isEmpty())
return;
1383 if (!writer.
save(filename, sizeInPt,
true)) {
1384 QMessageBox::warning(qApp->activeWindow(), i18nc(
"@title:window",
"Krita"), i18n(
"Could not save to svg: %1", filename));
1408 QMessageBox::information(view->mainWindowAsQWidget(),
1409 i18nc(
"@title:window",
"Layer %1 is not editable", parentNode->
name()),
1410 i18n(
"Cannot write alpha channel of "
1411 "the parent layer \"%1\".\n"
1412 "The operation will be cancelled.", parentNode->
name()));
1417 if (writeToLayers) {
1423 copyDevice = parentNode->
original();
1433 const QRect processRect =
1438 QScopedPointer<KisTransaction> transaction;
1440 if (writeToLayers) {
1441 commandsAdapter.beginMacro(
kundo2_i18n(
"Write Alpha into a Layer"));
1449 quint8 *alpha8Ptr = srcIt.
rawData();
1450 quint8 *dstPtr = dstIt.
rawData();
1455 if (writeToLayers) {
1456 commandsAdapter.addExtraCommand(transaction->endAndTake());
1457 commandsAdapter.removeNode(node);
1458 commandsAdapter.endMacro();
1461 QRect saveRect = image->
bounds();
1463 saveDeviceAsImage(dstDevice, parentNode->
name(),
1485 if (nodes.isEmpty() || !active)
return;
1489 for (
auto &node : nodes) {
1498 if (nodes.isEmpty() || !active)
return;
1500 bool isVisible = active->
visible();
1502 for (
auto &node : nodes) {
1511 if (nodes.isEmpty() || !active)
return;
1513 auto layer = qobject_cast<KisPaintLayer*>(active.
data());
1518 bool isAlphaLocked = layer->alphaLocked();
1519 for (
auto &node : nodes) {
1520 auto layer = qobject_cast<KisPaintLayer*>(node.data());
1531 if (nodes.isEmpty() || !active)
return;
1533 auto layer = qobject_cast<KisLayer*>(active.
data());
1538 bool isAlphaDisabled = layer->alphaChannelDisabled();
1539 for (
auto &node : nodes) {
1540 auto layer = qobject_cast<KisLayer*>(node.data());
1567 if (nodes.isEmpty())
return;
1569 KisNodeList::Iterator it = nodes.begin();
1570 while (it != nodes.end()) {
1572 if (!it->data()->parent()) {
1601 Q_ASSERT(shapeController);
1604 Q_ASSERT(dummiesFacade);
1606 const bool copyNode =
false;
1619 preferredClipCenter,
1624 const QString &overrideGroupName,
1629 if (!active)
return false;
1634 QString groupName = !overrideGroupName.isEmpty() ? overrideGroupName : image->
nextLayerName(i18nc(
"A group of layers",
"Group"));
1644 if (nodes2.size() == 0)
return false;
1647 active = nodes2.first();
1653 juggler->
addNode(nodes1, parent, aboveThis);
1654 juggler->
moveNode(nodes2, group, 0);
1657 *newLastChild = nodes2.last();
1693 if (!active)
return;
1701 auto incompatibleNode =
1702 std::find_if(nodes.begin(), nodes.end(),
1704 return !newParent->allowAsChild(node);
1707 if (incompatibleNode != nodes.end()) {
1708 const QString message =
1709 newParent->parent() ?
1710 i18n(
"Cannot move layer \"%1\" into new parent \"%2\"",
1711 (*incompatibleNode)->name(),
1712 newParent->name()) :
1713 i18n(
"Cannot move layer \"%1\" into the root layer",
1714 (*incompatibleNode)->name());
1726 if (checkCanMoveLayers(nodes, parent)) {
1728 juggler->
moveNode(nodes, parent, active);
1731 }
else if (parent && parent->parent()) {
1732 KisNodeSP grandParent = parent->parent();
1739 if (checkCanMoveLayers(allSelectedNodes, parent)) {
1741 juggler->
moveNode(allSelectedNodes, grandParent, parent);
1760 if (!nodes.isEmpty()) {
1817 if (!sender()->property(
"node").isNull()) {
1818 QString name = sender()->property(
"node").toString();
float value(const T *src, size_t ch)
QList< QString > QStringList
const quint8 OPACITY_OPAQUE_U8
char nodeType(const KoPathPoint *point)
A KisActionManager class keeps track of KisActions. These actions are always associated with the GUI....
KisAction * createAction(const QString &name)
KisAction * actionByName(const QString &name) const
void setActivationFlags(ActivationFlags flags)
@ ACTIVE_SHAPE_LAYER
Activate if the current node is a vector layer.
KisImageWSP currentImage() const
KisCoordinatesConverter * coordinatesConverter
void setCurrentShapeManagerOwnerShape(KoShape *source) override
sets the group shape that is supposed to be "entered"
void addCommand(KUndo2Command *command) override
KisAbstractCanvasWidget * canvasWidget
KoShapeManager * globalShapeManager() const
static KisClipboard * instance()
void setLayers(KisNodeList nodes, KisImageSP image, const QRect referenceRect, bool forceCopy=false)
const QMimeData * layersMimeData() const
virtual QRect bounds() const =0
KoShapeLayer * shapeForNode(KisNodeSP layer) const
virtual KisNodeDummy * dummyForNode(KisNodeSP node) const =0
void setLastActivatedNode(KisNodeSP node)
KisNodeSP lastActivatedNode() const
bool isIsolatingLayer() const
bool startIsolatedMode(KisNodeSP node, bool isolateLayer, bool isolateGroup)
KisGroupLayerSP rootLayer() const
void sigRequestNodeReselection(KisNodeSP activeNode, const KisNodeList &selectedNodes)
const KoColorSpace * colorSpace() const
QString nextLayerName(const QString &baseName="") const
KisPaintDeviceSP projection() const
void initialRefreshGraph()
bool isIsolatingGroup() const
QRect bounds() const override
void setResolution(double xres, double yres)
static QStringList supportedMimeTypes(Direction direction)
A container for a set of QAction objects.
QAction * action(int index) const
KisNodeSP addShapeLayer(KisNodeSP activeNode)
KisNodeSP addGeneratorLayer(KisNodeSP activeNode)
void setView(QPointer< KisView >view)
KisNodeSP addFileLayer(KisNodeSP activeNode)
void activateLayer(KisLayerSP layer)
KisPaintDeviceSP activeDevice()
void setup(KisActionManager *actionManager)
void convertLayerToFileLayer(KisNodeSP source)
KisLayerSP addPaintLayer(KisNodeSP activeNode)
KisNodeSP addGroupLayer(KisNodeSP activeNode)
KisNodeSP addCloneLayer(KisNodeList nodes)
void convertNodeToPaintLayer(KisNodeSP source)
KisNodeSP addAdjustmentLayer(KisNodeSP activeNode)
static const KoID inheritAlpha
static const KoID onionSkins
static const KoID alphaLocked
static void setNodePropertyAutoUndo(KisNodeSP node, const KoID &id, const QVariant &value, KisImageSP image)
static KisBaseNode::Property getProperty(const KoID &id, bool state)
static const KoID visible
KisNodeSP createTransformMask(KisNodeSP activeNode)
void setup(KisKActionCollection *actionCollection, KisActionManager *actionManager)
void activateMask(KisMaskSP mask)
KisNodeSP createSelectionMask(KisNodeSP activeNode, KisPaintDeviceSP copyFrom, bool convertActiveNode)
KisPaintDeviceSP activeDevice()
KisNodeSP createColorizeMask(KisNodeSP activeNode)
void setView(QPointer< KisView >view)
KisNodeSP createFastColorOverlayMask(KisNodeSP activeNode)
KisNodeSP createTransparencyMask(KisNodeSP activeNode, KisPaintDeviceSP copyFrom, bool convertActiveNode)
KisNodeSP createFilterMask(KisNodeSP activeNode, KisPaintDeviceSP copyFrom, bool quiet, bool convertActiveNode)
QString createMaskNameCommon(KisNodeSP targetNode, const QString &nodeType, const QString &desiredName)
static bool insertMimeLayers(const QMimeData *data, MimeSource mimeSource, KisImageSP image, KisShapeController *shapeController, KisNodeDummy *parentDummy, KisNodeDummy *aboveThisDummy, bool copyNode, KisNodeInsertionAdapter *nodeInsertionAdapter, std::optional< QPoint > preferredClipCenter=std::nullopt, KisProcessingApplicator *applicator=nullptr)
static QString mimeTypeForFile(const QString &file, bool checkExistingFiles=true)
Find the mimetype for the given filename. The filename must include a suffix.
void moveNode(KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis)
void setNodeName(KisNodeSP node, const QString &name)
void setOpacity(KisNodeSP node, qint32 opacity)
void setCompositeOp(KisNodeSP node, const KoCompositeOp *compositeOp)
void beginMacro(const KUndo2MagicString ¯oName)
KisNodeDummy * lastChild() const
void removeNode(const KisNodeList &nodes)
void raiseNode(const KisNodeList &nodes)
void addNode(const KisNodeList &nodes, KisNodeSP dstParent, KisNodeSP dstAbove)
void duplicateNode(const KisNodeList &nodes)
void copyNode(const KisNodeList &nodes, KisNodeSP dstParent, KisNodeSP dstAbove)
void lowerNode(const KisNodeList &nodes)
void moveNode(KisNodeSP node, KisNodeSP parent, KisNodeSP above)
void activateNextNode(bool siblingsOnly=false)
void toggleIsolateActiveNode()
static bool isNodeHidden(KisNodeSP node, bool isGlobalSelectionHidden)
void selectLayersImpl(const KoProperties &props, const KoProperties &invertedProps)
void setIsolateActiveGroupMode(bool checked)
void activatePreviousSiblingNode()
KisNodeDisplayModeAdapter * nodeDisplayModeAdapter() const
void createReferenceImageFromVisible()
KisNodeInsertionAdapter * nodeInsertionAdapter() const
void setView(QPointer< KisView >imageView)
bool canMoveLayer(KisNodeSP node, bool showWarning=true)
void copyNodesDirect(KisNodeList nodes, KisNodeSP parent, KisNodeSP aboveThis)
void colorOverlayMaskProperties(KisNodeSP node)
void nodeOpacityChanged(qreal opacity)
void sigUiNeedChangeActiveNode(KisNodeSP node)
void slotPinToTimeline(bool value)
void slotSplitAlphaWrite()
void setNodeOpacity(KisNodeSP node, qint32 opacity)
void slotUiActivateNode()
slotUiActivateNode inspects the sender to see which node needs to be activated.
void changeCloneSource()
pop up a window for changing the source of the selected Clone Layers
void toggleInheritAlpha()
void moveNodesDirect(KisNodeList nodes, KisNodeSP parent, KisNodeSP aboveThis)
void switchToPreviouslyActiveNode()
void setIsolateActiveLayerMode(bool checked)
void setup(KisKActionCollection *collection, KisActionManager *actionManager)
void handleExternalIsolationChange()
void pasteLayersFromClipboard(std::optional< QPoint > preferredClipCenter=std::nullopt, KisProcessingApplicator *applicator=nullptr)
KisNodeSP activeNode()
Convenience function to get the active layer or mask.
KisNodeList selectedNodes()
void nodePropertiesIgnoreSelection(KisNodeSP node)
void selectInvisibleNodes()
void slotImageRequestNodeReselection(KisNodeSP activeNode, const KisNodeList &selectedNodes)
void mirrorNodes(KisNodeList nodes, const KUndo2MagicString &commandName, Qt::Orientation orientation, KisSelectionSP selection)
void sigUiNeedChangeSelectedNodes(const QList< KisNodeSP > &nodes)
void activatePreviousNode(bool siblingsOnly=false)
const KoColorSpace * activeColorSpace()
void setNodeCompositeOp(KisNodeSP node, const KoCompositeOp *compositeOp)
void changeIsolationRoot(KisNodeSP isolationRoot)
void addNodesDirect(KisNodeList nodes, KisNodeSP parent, KisNodeSP aboveThis)
KisPaintDeviceSP activePaintDevice()
Get the paint device the user wants to paint on now.
void setNodeName(KisNodeSP node, const QString &name)
qint32 convertOpacityToInt(qreal opacity)
void mirrorNode(KisNodeSP node, const KUndo2MagicString &commandName, Qt::Orientation orientation, KisSelectionSP selection)
void duplicateActiveNode()
bool createQuickGroupImpl(KisNodeJugglerCompressed *juggler, const QString &overrideGroupName, KisNodeSP *newGroup, KisNodeSP *newLastChild)
void slotSetSelectedNodes(const KisNodeList &nodes)
slotSetSelectedNodes set the list of nodes selected in the layerbox. Selected nodes are not necessari...
void selectUnlockedNodes()
void cutLayersToClipboard()
bool canModifyLayers(KisNodeList nodes, bool showWarning=true)
KisNodeSelectionAdapter * nodeSelectionAdapter() const
void slotSplitAlphaSaveMerged()
bool trySetNodeProperties(KisNodeSP node, KisImageSP image, KisBaseNode::PropertyList properties) const
KisNodeSP createNode(const QString &nodeType, bool quiet=false, KisPaintDeviceSP copyFrom=0)
bool canModifyLayer(KisNodeSP node, bool showWarning=true)
void slotNonUiActivatedNode(KisNodeSP node)
void nodeProperties(KisNodeSP node)
void sigNodeActivated(KisNodeSP node)
emitted whenever a node is selected.
void createReferenceImage(bool fromLayer)
KisNodeManager(KisViewManager *view)
void moveNodeAt(KisNodeSP node, KisNodeSP parent, int index)
~KisNodeManager() override
void activateNextSiblingNode()
void slotSplitAlphaIntoMask()
void createQuickClippingGroup()
void removeSingleNode(KisNodeSP node)
void createReferenceImageFromLayer()
void reinitializeIsolationActionGroup()
void slotSomethingActivatedNodeImpl(KisNodeSP node)
KisLayerSP createPaintLayer()
bool canMoveLayers(KisNodeList nodes, bool showWarning=true)
void nodeCompositeOpChanged(const KoCompositeOp *op)
void removeSelectedNodes(KisNodeList selectedNodes)
void changeIsolationMode(bool isolateActiveLayer, bool isolateActiveGroup)
void convertNode(const QString &nodeType)
void selectVisibleNodes()
void slotUiActivatedNode(KisNodeSP node)
void saveVectorLayerAsImage()
void copyLayersToClipboard()
static void setNodePropertiesAutoUndo(KisNodeSP node, KisImageSP image, PropertyList proplist)
virtual const KoColorSpace * compositionSourceColorSpace() const
QRect exactBounds() const
const KoColorSpace * colorSpace() const
KoColor defaultPixel() const
QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) const
KisDefaultBoundsBaseSP defaultBounds() const
void makeCloneFrom(KisPaintDeviceSP src, const QRect &rect)
static KisPart * instance()
void applyVisitor(KisProcessingVisitorSP visitor, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
void applyVisitorAllFrames(KisProcessingVisitorSP visitor, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
static KisReferenceImage * fromQImage(const KisCoordinatesConverter &converter, const QImage &img)
static KUndo2Command * addReferenceImages(KisDocument *document, QList< KoShape * > referenceImages)
ALWAYS_INLINE quint8 * rawData()
The KisSignalMapper class bundles signals from identifiable senders.
bool blockUntilOperationsFinished(KisImageSP image)
blockUntilOperationsFinished blocks the GUI of the application until execution of actions on image is...
KisDocument * document() const
KisActionManager * actionManager() const
KisCanvas2 * canvasBase() const
Return the canvas base class.
KoToolManager * toolManager() const
KisSelectionSP selection()
KisLayerSP activeLayer()
Convenience method to get at the active layer.
void blockUntilOperationsFinishedForced(KisImageSP image)
blockUntilOperationsFinished blocks the GUI of the application until execution of actions on image is...
virtual KisKActionCollection * actionCollection() const
KisSelectionManager * selectionManager()
QWidget * mainWindowAsQWidget() const
KisImageWSP image() const
Return the image this view is displaying.
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
virtual quint32 pixelSize() const =0
virtual void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
void setProperty(const QString &name, const QVariant &value)
void deselectAll()
clear the selections list
void setActiveLayer(KoShapeLayer *layer)
void select(KoShape *shape)
QList< KoShape * > shapes() const
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
Implements exporting shapes to SVG.
bool save(QIODevice &outputDevice, const QSizeF &pageSize)
Writes svg to specified output device.
#define KIS_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_RETURN(cond)
#define CONVERT_NODE_ACTION_2(id, layerType, exclude)
#define CONVERT_NODE_ACTION(id, layerType)
#define NEW_LAYER_ACTION(id, layerType)
QList< KisNodeSP > KisNodeList
KUndo2MagicString kundo2_i18n(const char *text)
KUndo2MagicString kundo2_noi18n(const QString &text)
KUndo2MagicString kundo2_i18np(const char *sing, const char *plur, const A1 &a1)
void splitAlphaToMask(KisImageSP image, KisNodeSP node, const QString &maskName)
void sortMergeableNodes(KisNodeSP root, KisNodeList &inputNodes, KisNodeList &outputNodes)
KisNodeSP findNodeByName(KisNodeSP root, const QString &name)
KisNodeList findNodesWithProps(KisNodeSP root, const KoProperties &props, bool excludeRoot)
void newLayerFromVisible(KisImageSP image, KisNodeSP putAfter, MergeFlags flags)
void filterMergeableNodes(KisNodeList &nodes, bool allowMasks)
bool checkIsChildOf(KisNodeSP node, const KisNodeList &parents)
bool compareListsUnordered(const QList< T > &a, const QList< T > &b)
void setPinnedToTimeline(bool pinned)
virtual KisPaintDeviceSP projection() const =0
bool isEditable(bool checkVisibility=true) const
bool isPinnedToTimeline() const
virtual QRect exactBounds() const
virtual KisPaintDeviceSP original() const =0
virtual KisPaintDeviceSP paintDevice() const =0
virtual bool isFakeNode() const
virtual bool visible(bool recursive=false) const
bool hasEditablePaintDevice() const
KisPaintDeviceSP projection() const override
void disableAlphaChannel(bool disable)
virtual KisSelectionMaskSP selectionMask() const
const KoColorSpace * colorSpace() const override
returns the image's colorSpace or null, if there is no image
KisFilterMaskSP colorOverlayMask() const
KisLayerSP parentLayer() const
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
void mergeTransparencyMaskAsAlpha(bool writeToLayers)
QScopedPointer< KisNodeSelectionAdapter > nodeSelectionAdapter
bool activateNodeImpl(KisNodeSP node)
void saveDeviceAsImage(KisPaintDeviceSP device, const QString &defaultName, const QRect &bounds, qreal xRes, qreal yRes, quint8 opacity)
KisNodeCommandsAdapter commandsAdapter
KisSynchronizedConnection< KisNodeSP, KisNodeList > activateNodeConnection
KisLayerManager layerManager
bool lastRequestedIsolatedModeStatus
KisMaskManager maskManager
KisNodeWSP previouslyActiveNode
QScopedPointer< KisNodeInsertionAdapter > nodeInsertionAdapter
KisSignalMapper nodeCreationSignalMapper
QPointer< KisNodeJugglerCompressed > nodeJuggler
KisNodeJugglerCompressed * lazyGetJuggler(const KUndo2MagicString &actionName)
Private(KisNodeManager *_q, KisViewManager *v)
QPointer< KisView > imageView
KisSignalMapper nodeConversionSignalMapper
KisAction * pinToTimeline
QScopedPointer< KisNodeDisplayModeAdapter > nodeDisplayModeAdapter
KisNodeList selectedNodes
KisNodeSP prevSibling() const
KisNodeSP firstChild() const
QList< KisNodeSP > childNodes(const QStringList &nodeTypes, const KoProperties &properties) const
quint32 childCount() const
KisNodeSP lastChild() const
KisNodeSP nextSibling() const
KisNodeGraphListener * graphListener
KisPaintDeviceSP paintDevice
void setActive(bool active)
bool hasShapeSelection() const