Krita Source Code Documentation
Loading...
Searching...
No Matches
KisImportCatcher::Private Struct Reference

Public Member Functions

void importAsPaintLayer (KisPaintDeviceSP device, QString layerName)
 
void importShapeLayer (KisShapeLayerSP shapeLayer)
 
QString prettyLayerName (QString layerName) const
 

Public Attributes

KisDocumentdoc
 
QString layerType
 
int numLayersImported
 
QString path
 
KisViewManagerview
 

Detailed Description

Definition at line 30 of file kis_import_catcher.cc.

Member Function Documentation

◆ importAsPaintLayer()

void KisImportCatcher::Private::importAsPaintLayer ( KisPaintDeviceSP device,
QString layerName )

Definition at line 55 of file kis_import_catcher.cc.

56{
57 KisLayerSP newLayer = new KisPaintLayer(view->image(),
58 layerName,
60 device);
61
62 KisNodeSP parent = nullptr;
63 KisLayerSP currentActiveLayer = view->activeLayer();
64
65 if (currentActiveLayer) {
66 parent = currentActiveLayer->parent();
67 }
68
69 if (parent.isNull()) {
70 parent = view->image()->rootLayer();
71 }
72
74 adapter.addNode(newLayer, parent, currentActiveLayer);
75}
const quint8 OPACITY_OPAQUE_U8
KisGroupLayerSP rootLayer() const
KisLayerSP activeLayer()
Convenience method to get at the active layer.
KisImageWSP image() const
Return the image this view is displaying.
ChildIterator< value_type, is_const > parent(const ChildIterator< value_type, is_const > &it)
Definition KisForest.h:327
KisNodeWSP parent
Definition kis_node.cpp:86

References KisNodeCommandsAdapter::addNode(), OPACITY_OPAQUE_U8, and KisNode::parent.

◆ importShapeLayer()

void KisImportCatcher::Private::importShapeLayer ( KisShapeLayerSP shapeLayer)

Definition at line 77 of file kis_import_catcher.cc.

78{
79 KisNodeSP parent = nullptr;
80 KisLayerSP currentActiveLayer = view->activeLayer();
81
82 if (currentActiveLayer) {
83 parent = currentActiveLayer->parent();
84 }
85
86 if (parent.isNull()) {
87 parent = view->image()->rootLayer();
88 }
89
91 adapter.addNode(shapeLayer, parent, currentActiveLayer);
92}

References KisNodeCommandsAdapter::addNode(), and KisNode::parent.

◆ prettyLayerName()

QString KisImportCatcher::Private::prettyLayerName ( QString layerName) const

Definition at line 44 of file kis_import_catcher.cc.

45{
46 QString name = QFileInfo(path).fileName();
47 QString fileName = !name.isEmpty() ? name : path;
48 // The "Background" name here being matched on is dependent on the current language and so needs to be passed
49 // through i18n.
50 return (layerName.isEmpty() || layerName == i18nc("Name for the bottom-most layer in the layerstack", "Background"))
51 ? fileName
52 : layerName;
53}
const char * name(StandardAction id)

References path.

Member Data Documentation

◆ doc

KisDocument* KisImportCatcher::Private::doc

Definition at line 33 of file kis_import_catcher.cc.

◆ layerType

QString KisImportCatcher::Private::layerType

Definition at line 36 of file kis_import_catcher.cc.

◆ numLayersImported

int KisImportCatcher::Private::numLayersImported

Definition at line 37 of file kis_import_catcher.cc.

◆ path

QString KisImportCatcher::Private::path

Definition at line 35 of file kis_import_catcher.cc.

◆ view

KisViewManager* KisImportCatcher::Private::view

Definition at line 34 of file kis_import_catcher.cc.


The documentation for this struct was generated from the following file: