Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_dlg_layer_style.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
8
9#include <QBuffer>
10#include <QCheckBox>
11#include <QDial>
12#include <QInputDialog>
13#include <QItemSelectionModel>
14#include <QListWidget>
15#include <QListWidgetItem>
16#include <QSpinBox>
17#include <QStackedWidget>
18#include <QTreeWidget>
19#include <QUuid>
20#include <QWidget>
21
22#include <KoColorPopupButton.h>
25#include <KoMD5Generator.h>
27
28#include "KisResourceTypes.h"
30#include "kis_config.h"
31#include "kis_cmb_contour.h"
32#include "kis_cmb_gradient.h"
34#include "kis_psd_layer_style.h"
35#include <KisAslStorage.h>
36#include <KisResourceLocator.h>
38#include <KisStorageModel.h>
40
41#include "kis_signals_blocker.h"
45
46#include <KoFileDialog.h>
47#include <QMessageBox>
48
50 KisCanvasResourceProvider *resourceProvider)
51{
52 if (!gradient) {
53 gradient = resourceProvider->currentGradient();
54 }
55 return gradient;
56}
57
59 : KoDialog(parent)
60 , m_layerStyle(layerStyle)
61 , m_initialLayerStyle(layerStyle->clone().dynamicCast<KisPSDLayerStyle>())
62 , m_isSwitchingPredefinedStyle(false)
63 , m_sanityLayerStyleDirty(false)
64{
65 setCaption(i18n("Layer Styles"));
68
71 connect(m_configChangedCompressor, SIGNAL(timeout()), SIGNAL(configChanged()));
72
73 QWidget *page = new QWidget(this);
74 wdgLayerStyles.setupUi(page);
75 setMainWidget(page);
76 wdgLayerStyles.chkPreview->setVisible(false);
77
78 connect(wdgLayerStyles.lstStyleSelector, SIGNAL(itemChanged(QListWidgetItem*)), SLOT(notifyGuiConfigChanged()));
79
82 wdgLayerStyles.stylesStack->addWidget(m_stylesSelector);
83
85 wdgLayerStyles.stylesStack->addWidget(m_blendingOptions);
86 // currently unimplemented, hide for now
87 wdgLayerStyles.lstStyleSelector->item(1)->setHidden(true);
88
90 wdgLayerStyles.stylesStack->addWidget(m_dropShadow);
92
94 wdgLayerStyles.stylesStack->addWidget(m_innerShadow);
96
97 m_outerGlow = new InnerGlow(InnerGlow::OuterGlowMode, resourceProvider, this);
98 wdgLayerStyles.stylesStack->addWidget(m_outerGlow);
100
101 m_innerGlow = new InnerGlow(InnerGlow::InnerGlowMode, resourceProvider, this);
102 wdgLayerStyles.stylesStack->addWidget(m_innerGlow);
104
105 // Contour and Texture are sub-styles of Bevel and Emboss
106 // They are only applied to canvas when Bevel and Emboss is active.
107 m_contour = new Contour(this);
108 m_texture = new Texture(this);
110
111 wdgLayerStyles.stylesStack->addWidget(m_bevelAndEmboss);
112 wdgLayerStyles.stylesStack->addWidget(m_contour);
113 wdgLayerStyles.stylesStack->addWidget(m_texture);
114
115 // slotBevelAndEmbossChanged(QListWidgetItem*) enables/disables Contour and Texture on "Bevel and Emboss" toggle.
116 connect(wdgLayerStyles.lstStyleSelector, SIGNAL(itemClicked(QListWidgetItem*)), SLOT(slotBevelAndEmbossChanged(QListWidgetItem*)));
118
119 m_satin = new Satin(this);
120 wdgLayerStyles.stylesStack->addWidget(m_satin);
122
123 m_colorOverlay = new ColorOverlay(this);
124 wdgLayerStyles.stylesStack->addWidget(m_colorOverlay);
126
127 m_gradientOverlay = new GradientOverlay(resourceProvider, this);
128 wdgLayerStyles.stylesStack->addWidget(m_gradientOverlay);
130
132 wdgLayerStyles.stylesStack->addWidget(m_patternOverlay);
134
135 m_stroke = new Stroke(resourceProvider, this);
136 wdgLayerStyles.stylesStack->addWidget(m_stroke);
138
139 KisConfig cfg(true);
140 wdgLayerStyles.stylesStack->setCurrentIndex(cfg.readEntry("KisDlgLayerStyle::current", 0));
141 wdgLayerStyles.lstStyleSelector->setCurrentRow(cfg.readEntry("KisDlgLayerStyle::current", 0));
142
143 connect(wdgLayerStyles.lstStyleSelector,
144 SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
145 this, SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
146
147 // improve the checkbox visibility by altering the style sheet list a bit
148 // the dark themes make them hard to see
149 QPalette newPalette = palette();
150 newPalette.setColor(QPalette::Active, QPalette::Window, palette().text().color() );
151 wdgLayerStyles.lstStyleSelector->setPalette(newPalette);
152
153
155
156 connect(m_dropShadow, SIGNAL(globalAngleChanged(int)), SLOT(syncGlobalAngle(int)));
157 connect(m_innerShadow, SIGNAL(globalAngleChanged(int)), SLOT(syncGlobalAngle(int)));
158 connect(m_bevelAndEmboss, SIGNAL(globalAngleChanged(int)), SLOT(syncGlobalAngle(int)));
159
160
161 connect(wdgLayerStyles.btnNewStyle, SIGNAL(clicked()), SLOT(slotNewStyle()));
162 connect(wdgLayerStyles.btnLoadStyle, SIGNAL(clicked()), SLOT(slotLoadStyle()));
163 connect(wdgLayerStyles.btnSaveStyle, SIGNAL(clicked()), SLOT(slotSaveStyle()));
164
165 connect(wdgLayerStyles.chkMasterFxSwitch, SIGNAL(toggled(bool)), SLOT(slotMasterFxSwitchChanged(bool)));
166
167 connect(this, SIGNAL(accepted()), SLOT(slotNotifyOnAccept()));
168 connect(this, SIGNAL(rejected()), SLOT(slotNotifyOnReject()));
169}
170
174
176{
177 wdgLayerStyles.lstStyleSelector->setEnabled(value);
178 wdgLayerStyles.stylesStack->setEnabled(value);
179 wdgLayerStyles.btnNewStyle->setEnabled(value);
180 wdgLayerStyles.btnLoadStyle->setEnabled(value);
181 wdgLayerStyles.btnSaveStyle->setEnabled(value);
183}
184
194
202
204 QListWidgetItem *item;
205
206 if (wdgLayerStyles.lstStyleSelector->item(6)->checkState() == Qt::Checked) {
207 // Enable "Contour" (list item 7)
208 item = wdgLayerStyles.lstStyleSelector->item(7);
209 Qt::ItemFlags currentFlags7 = item->flags();
210 item->setFlags(currentFlags7 | Qt::ItemIsEnabled);
211
212 // Enable "Texture" (list item 8)
213 item = wdgLayerStyles.lstStyleSelector->item(8);
214 Qt::ItemFlags currentFlags8 = item->flags();
215 item->setFlags(currentFlags8 | Qt::ItemIsEnabled);
216 }
217 else {
218 // Disable "Contour"
219 item = wdgLayerStyles.lstStyleSelector->item(7);
220 Qt::ItemFlags currentFlags7 = item->flags();
221 item->setFlags(currentFlags7 & (~Qt::ItemIsEnabled));
222
223 // Disable "Texture"
224 item = wdgLayerStyles.lstStyleSelector->item(8);
225 Qt::ItemFlags currentFlags8 = item->flags();
226 item->setFlags(currentFlags8 & (~Qt::ItemIsEnabled));
227 }
228}
229
237
245
246bool checkCustomNameAvailable(const QString &name)
247{
248 Q_UNUSED(name);
249 const QString customName = "CustomStyles.asl";
251 KoResourceSP resource = server->resource("", "", customName);
252 return !resource;
253}
254
255QString selectAvailableStyleName(const QString &name)
256{
257 QString finalName = name;
258 if (checkCustomNameAvailable(finalName)) {
259 return finalName;
260 }
261
262 int i = 0;
263
264 do {
265 finalName = QString("%1%2").arg(name).arg(i++);
266 } while (!checkCustomNameAvailable(finalName));
267
268 return finalName;
269}
270
272{
273 bool success;
274 QString styleName =
275 QInputDialog::getText(this,
276 i18nc("@title:window", "Enter new style name"),
277 i18nc("@label:textbox", "Name:"),
278 QLineEdit::Normal,
279 i18nc("Default name for a new style", "New Style"),
280 &success);
281
282 if (!success)
283 return;
284
285 KisPSDLayerStyleSP clone = this->style()->clone().dynamicCast<KisPSDLayerStyle>();
286 clone->setName(styleName);
287 clone->setUuid(QUuid::createUuid());
288 clone->setFilename(clone->uuid().toString());
289 clone->setValid(true);
290
291 const QString customStylesStorageLocation = "asl/CustomStyles.asl";
292 QString resourceDir = KoResourcePaths::getAppDataLocation();
293 QString storagePath = resourceDir + "/" + customStylesStorageLocation;
294
295 bool resourceAdded = false;
296
297 if (KisResourceLocator::instance()->hasStorage(storagePath)) {
298 // storage is named by the folder + filename, NOT the full filepath
299 resourceAdded = KisResourceUserOperations::addResourceWithUserInput(this, clone, customStylesStorageLocation);
300 } else {
302 serializer.setStyles(QVector<KisPSDLayerStyleSP>() << clone);
303 serializer.saveToFile(storagePath);
305 resourceAdded = KisResourceLocator::instance()->addStorage(storagePath, storage);
306
308 auto adapter = interface->source<KisPSDLayerStyle>(ResourceType::LayerStyles);
309 clone = adapter.bestMatch(clone->md5Sum(false), clone->filename(), clone->name());
310 resourceAdded = bool(clone);
311 }
312
313 if (resourceAdded) {
314 m_stylesSelector->addNewStyle(customStylesStorageLocation, clone);
315
316 setStyle(clone);
317
318 // focus on the recently added item
319 wdgLayerStyles.stylesStack->setCurrentWidget(m_stylesSelector);
320 }
321}
322
323QString createNewAslPath(QString resourceFolderPath, QString filename)
324{
325 return resourceFolderPath + '/' + "asl" + '/' + filename;
326}
327
329{
330 KoFileDialog dialog(this, KoFileDialog::OpenFile, "layerstyle");
331 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
332 dialog.setMimeTypeFilters({"application/x-photoshop-style-library"});
333 dialog.setCaption(i18n("Select ASL file"));
334
335 const QString filename = dialog.filename();
336
337 // XXX: implement a resource loader targeting layer style libraries
338 // const auto resource = KisResourceUserOperations::importResourceFileWithUserInput(this, "", ResourceType::LayerStylesLibrary, filename);
339 // if (resource) {
340 // m_stylesSelector->refillCollections();
341 // }
342
343 if (!filename.isEmpty()) {
344 const QFileInfo oldFileInfo(filename);
345
346 // 0. Validate layer style
347 {
349 KIS_ASSERT(!storage.isNull());
350
351 if (!storage->valid()) {
352 qWarning() << "Attempted to import an invalid layer style library!" << filename;
353 QMessageBox::warning(this,
354 i18nc("@title:window", "Krita"),
355 i18n("Could not load layer style library %1.", filename));
356 return;
357 }
358 }
359
360 // 1. Copy the layer style to the resource folder
361 const QString newDir = KoResourcePaths::getAppDataLocation();
362 const QString newName = oldFileInfo.fileName();
363 const QString newLocation = QStringLiteral("%1/%2").arg(newDir, newName);
364
365 const QFileInfo newFileInfo(newLocation);
366
367 if (newFileInfo.exists()) {
368 if (QMessageBox::warning(this,
369 i18nc("@title:window", "Warning"),
370 i18n("There is already a layer style library with this name installed. Do you "
371 "want to overwrite it?"),
372 QMessageBox::Ok | QMessageBox::Cancel)
373 == QMessageBox::Cancel) {
374 return;
375 } else {
376 QFile::remove(newLocation);
377 }
378 }
379
380 QFile::copy(filename, newLocation);
381
382 // 2. Add the layer style as a storage/update database
384 KIS_ASSERT(!storage.isNull());
385 if (!KisResourceLocator::instance()->addStorage(newLocation, storage)) {
386 qWarning() << "Could not add layer style library to the storages" << newLocation;
387 }
389 }
390}
391
393{
394 QString filename; // default value?
395
396 KoFileDialog dialog(this, KoFileDialog::SaveFile, "layerstyle");
397 dialog.setCaption(i18n("Select ASL file"));
398 dialog.setMimeTypeFilters(QStringList() << "application/x-photoshop-style-library", "application/x-photoshop-style-library");
399 filename = dialog.filename();
400
402
403 KisPSDLayerStyleSP newStyle = style()->clone().dynamicCast<KisPSDLayerStyle>();
404 newStyle->setName(QFileInfo(filename).completeBaseName());
406 styles << newStyle;
407 serializer->setStyles(styles);
408 serializer->saveToFile(filename);
409}
410
411void KisDlgLayerStyle::changePage(QListWidgetItem *current, QListWidgetItem *previous)
412{
413 if (!current) {
414 current = previous;
415 }
416 wdgLayerStyles.stylesStack->setCurrentIndex(wdgLayerStyles.lstStyleSelector->row(current));
417}
418
420{
421 // we may self-assign style is some cases
422 if (style != m_layerStyle) {
423 m_layerStyle = style->clone().dynamicCast<KisPSDLayerStyle>();
424 }
426
427 {
430 }
431
432 QListWidgetItem *item;
433 item = wdgLayerStyles.lstStyleSelector->item(2);
434 item->setCheckState(m_layerStyle->dropShadow()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
435
436 item = wdgLayerStyles.lstStyleSelector->item(3);
437 item->setCheckState(m_layerStyle->innerShadow()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
438
439 item = wdgLayerStyles.lstStyleSelector->item(4);
440 item->setCheckState(m_layerStyle->outerGlow()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
441
442 item = wdgLayerStyles.lstStyleSelector->item(5);
443 item->setCheckState(m_layerStyle->innerGlow()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
444
445 item = wdgLayerStyles.lstStyleSelector->item(6);
446 item->setCheckState(m_layerStyle->bevelAndEmboss()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
447
448 item = wdgLayerStyles.lstStyleSelector->item(7);
449 item->setCheckState(m_layerStyle->bevelAndEmboss()->contourEnabled() ? Qt::Checked : Qt::Unchecked);
450
451 item = wdgLayerStyles.lstStyleSelector->item(8);
452 item->setCheckState(m_layerStyle->bevelAndEmboss()->textureEnabled() ? Qt::Checked : Qt::Unchecked);
453
454 item = wdgLayerStyles.lstStyleSelector->item(9);
455 item->setCheckState(m_layerStyle->satin()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
456
457 item = wdgLayerStyles.lstStyleSelector->item(10);
458 item->setCheckState(m_layerStyle->colorOverlay()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
459
460 item = wdgLayerStyles.lstStyleSelector->item(11);
461 item->setCheckState(m_layerStyle->gradientOverlay()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
462
463 item = wdgLayerStyles.lstStyleSelector->item(12);
464 item->setCheckState(m_layerStyle->patternOverlay()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
465
466 item = wdgLayerStyles.lstStyleSelector->item(13);
467 item->setCheckState(m_layerStyle->stroke()->effectEnabled() ? Qt::Checked : Qt::Unchecked);
468
469 m_dropShadow->setShadow(m_layerStyle->dropShadow());
470 m_innerShadow->setShadow(m_layerStyle->innerShadow());
471 m_outerGlow->setConfig(m_layerStyle->outerGlow());
472 m_innerGlow->setConfig(m_layerStyle->innerGlow());
474 m_satin->setSatin(m_layerStyle->satin());
478 m_stroke->setStroke(m_layerStyle->stroke());
479
480 wdgLayerStyles.chkMasterFxSwitch->setChecked(m_layerStyle->isEnabled());
482}
483
485{
486 m_layerStyle->setEnabled(wdgLayerStyles.chkMasterFxSwitch->isChecked());
487
488 m_layerStyle->dropShadow()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(2)->checkState() == Qt::Checked);
489 m_layerStyle->innerShadow()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(3)->checkState() == Qt::Checked);
490 m_layerStyle->outerGlow()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(4)->checkState() == Qt::Checked);
491 m_layerStyle->innerGlow()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(5)->checkState() == Qt::Checked);
492 m_layerStyle->bevelAndEmboss()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(6)->checkState() == Qt::Checked);
493 m_layerStyle->bevelAndEmboss()->setContourEnabled(wdgLayerStyles.lstStyleSelector->item(7)->checkState() == Qt::Checked);
494 m_layerStyle->bevelAndEmboss()->setTextureEnabled(wdgLayerStyles.lstStyleSelector->item(8)->checkState() == Qt::Checked);
495 m_layerStyle->satin()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(9)->checkState() == Qt::Checked);
496 m_layerStyle->colorOverlay()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(10)->checkState() == Qt::Checked);
497 m_layerStyle->gradientOverlay()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(11)->checkState() == Qt::Checked);
498 m_layerStyle->patternOverlay()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(12)->checkState() == Qt::Checked);
499 m_layerStyle->stroke()->setEffectEnabled(wdgLayerStyles.lstStyleSelector->item(13)->checkState() == Qt::Checked);
500
501
502 m_dropShadow->fetchShadow(m_layerStyle->dropShadow());
503 m_innerShadow->fetchShadow(m_layerStyle->innerShadow());
504 m_outerGlow->fetchConfig(m_layerStyle->outerGlow());
505 m_innerGlow->fetchConfig(m_layerStyle->innerGlow());
512
515
516 return m_layerStyle;
517}
518
520{
522
523 if (style->dropShadow()->useGlobalLight()) {
524 style->dropShadow()->setAngle(angle);
525 }
526 if (style->innerShadow()->useGlobalLight()) {
527 style->innerShadow()->setAngle(angle);
528 }
529 if (style->bevelAndEmboss()->useGlobalLight()) {
530 style->bevelAndEmboss()->setAngle(angle);
531 }
532
534}
535
536/********************************************************************/
537/***** Styles Selector **********************************************/
538/********************************************************************/
539
541 : QSortFilterProxyModel(parent)
542{
543
544}
545
547{
548 m_enableFiltering = enableFiltering;
549 invalidateFilter();
550}
551
553{
554 m_locationToFilter = location;
555 invalidateFilter();
556}
557
558bool StylesSelector::LocationProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
559{
560 Q_UNUSED(source_parent);
561 if (!m_enableFiltering) {
562 return true;
563 }
564
565 QModelIndex idx = sourceModel()->index(source_row, 0);
566 QString location = sourceModel()->data(idx, Qt::UserRole + KisAbstractResourceModel::Location).toString();
567 qDebug() << sourceModel()->data(idx, Qt::UserRole + KisAbstractResourceModel::Location).toString()
568 << sourceModel()->data(idx, Qt::UserRole + KisAbstractResourceModel::Name).toString();
569 return location == m_locationToFilter;
570}
571
572
573
574
575class StyleItem : public QListWidgetItem {
576public:
578 : QListWidgetItem(style->name())
579 , m_style(style)
580 {
581 }
582
583public:
585};
586
587
589 : QWidget(parent)
590{
591 ui.setupUi(this);
592
595 m_locationsProxyModel->setSourceModel(m_resourceModel);
597
598 ui.listStyles->setModel(m_locationsProxyModel);
599 ui.listStyles->setModelColumn(KisAbstractResourceModel::Name);
600 // XXX: support editing
601 // KisResourceModel doesn't support data with the EditRole
602 ui.listStyles->setEditTriggers(QAbstractItemView::EditTrigger::NoEditTriggers);
603
604 connect(ui.cmbStyleCollections, SIGNAL(textActivated(QString)), this, SLOT(loadStyles(QString)));
605 connect(ui.listStyles, SIGNAL(clicked(QModelIndex)), this, SLOT(selectStyle(QModelIndex)));
606
608
609 if (ui.cmbStyleCollections->count()) {
610 ui.cmbStyleCollections->setCurrentIndex(0);
612 loadStyles(ui.cmbStyleCollections->currentText());
613 }
614}
615
617{
618 QStringList locationsList;
619 for (int i = 0; i < m_resourceModel->rowCount(); i++) {
620 QModelIndex idx = m_resourceModel->index(i, 0);
621 QString location = m_resourceModel->data(idx, Qt::UserRole + KisAbstractResourceModel::Location).toString();
622 if (!locationsList.contains(location)) {
623 locationsList << location;
624 }
625 }
626 ui.cmbStyleCollections->clear();
627 ui.cmbStyleCollections->addItems(locationsList);
628}
629
630void StylesSelector::notifyExternalStyleChanged(const QString &name, const QUuid &uuid)
631{
632 Q_UNUSED(name);
633 Q_UNUSED(uuid);
634 /*
635 int currentIndex = -1;
636
637 for (int i = 0; i < ui.listStyles->count(); i++ ) {
638 StyleItem *item = dynamic_cast<StyleItem*>(ui.listStyles->item(i));
639
640 QString itemName = item->m_style->name();
641
642 if (itemName == name) {
643 bool isDirty = item->m_style->uuid() != uuid;
644
645 if (isDirty) {
646 itemName += "*";
647 }
648
649 currentIndex = i;
650 }
651
652 item->setText(itemName);
653 }
654
655 ui.listStyles->setCurrentRow(currentIndex);
656 */
657}
658
659void StylesSelector::loadStyles(const QString &name)
660{
662}
663
664void StylesSelector::selectStyle(QModelIndex current)
665{
666
667 // the index is from the proxy model
668 QModelIndex sourceModelIndex = m_locationsProxyModel->mapToSource(current);
669 KoResourceSP resource = m_resourceModel->resourceForIndex(sourceModelIndex);
670 KisPSDLayerStyleSP layerStyle = resource.dynamicCast<KisPSDLayerStyle>();
671 qDebug() << "StylesSelector::selectStyle" << (resource.isNull() ? "(null)" : resource->name()) << (layerStyle.isNull() ? "(null)" : layerStyle->name());
672 if (layerStyle) {
673 Q_EMIT styleSelected(layerStyle);
674 }
675
676 /*
677 StyleItem *item = dynamic_cast<StyleItem*>(current);
678 if (item) {
679 Q_EMIT styleSelected(item->m_style);
680 }
681 */
682}
683
684void StylesSelector::loadCollection(const QString &fileName)
685{
686 Q_UNUSED(fileName);
687 // TODO: RESOURCES: implement or remove
688 warnKrita << "Collection cannot be loaded, because we do not use collections now; please use KisAslStorage instead.";
689
690 /*
691 if (!QFileInfo(fileName).exists()) {
692 warnKrita << "Loaded style collection doesn't exist!";
693 return;
694 }
695
696 KisPSDLayerStyleCollectionResourceSP collection = KisPSDLayerStyleCollectionResourceSP(new KisPSDLayerStyleCollectionResource(fileName));
697
698 collection->load();
699
700 KoResourceServer<KisPSDLayerStyleCollectionResource> *server = KisResourceServerProvider::instance()->layerStyleCollectionServer();
701 collection->setFilename(server->saveLocation() + '/' + collection->name());
702 server->addResource(collection);
703
704 refillCollections();
705
706 int index = ui.cmbStyleCollections->findText(collection->name());
707 ui.cmbStyleCollections->setCurrentIndex(index);
708 loadStyles(collection->name());
709 */
710}
711
713{
714 ENTER_FUNCTION() << "MODEL RESET!!!";
716}
717
718void StylesSelector::addNewStyle(const QString &location, KisPSDLayerStyleSP style)
719{
720 // m_resourceModel = new KisResourceModel(ResourceType::LayerStyles, this);
721 // m_locationsProxyModel->setSourceModel(m_resourceModel);
722 // ui.listStyles->setModel(m_locationsProxyModel);
723
725 ui.listStyles->reset();
726 ui.cmbStyleCollections->setCurrentText(location);
727 loadStyles(ui.cmbStyleCollections->currentText());
728 KIS_ASSERT(m_resourceModel->resourceForId(style->resourceId()));
729 ui.listStyles->setCurrentIndex(m_locationsProxyModel->mapFromSource(
730 m_resourceModel->indexForResource(style).siblingAtColumn(ui.listStyles->modelColumn())));
731
732 notifyExternalStyleChanged(style->name(), style->uuid());
733}
734
735/********************************************************************/
736/***** Bevel and Emboss *********************************************/
737/********************************************************************/
738
739BevelAndEmboss::BevelAndEmboss(Contour *contour, Texture *texture, QWidget *parent)
740 : QWidget(parent)
741 , m_contour(contour)
742 , m_texture(texture)
743{
744 ui.setupUi(this);
745
746 // Structure
747 ui.intDepth->setRange(0, 100);
748 KisSpinBoxI18nHelper::setText(ui.intDepth, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
749
750 ui.intSize->setRange(0, 250);
751 ui.intSize->setSuffix(i18n(" px"));
752 ui.intSize->setExponentRatio(2.0);
753
754 ui.intSoften->setRange(0, 18);
755 ui.intSoften->setSuffix(i18n(" px"));
756
757 connect(ui.cmbStyle, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
758 connect(ui.cmbTechnique, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
759 connect(ui.intDepth, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
760 connect(ui.cmbDirection, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
761 connect(ui.intSize, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
762 connect(ui.intSoften, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
763
764 // Shading
765 ui.intOpacity->setRange(0, 100);
766 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
767
768 ui.intOpacity2->setRange(0, 100);
769 KisSpinBoxI18nHelper::setText(ui.intOpacity2, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
770
771 ui.angleSelector->enableGlobalLight(true);
772 connect(ui.angleSelector, SIGNAL(globalAngleChanged(int)), SIGNAL(globalAngleChanged(int)));
773 connect(ui.angleSelector, SIGNAL(configChanged()), SIGNAL(configChanged()));
774
775 connect(ui.intAltitude, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
776 connect(ui.cmbContour, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
777 connect(ui.chkAntiAliased, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
778 connect(ui.cmbHighlightMode, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
779 connect(ui.bnHighlightColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
780 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
781 connect(ui.cmbShadowMode, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
782 connect(ui.bnShadowColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
783 connect(ui.intOpacity2, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
784
785 // Contour
786 m_contour->ui.intRange->setRange(1, 100);
788 i18nc("{n} is the number value, % is the percent sign", "{n}%"));
789
790 connect(m_contour->ui.cmbContour, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
791 connect(m_contour->ui.chkAntiAliased, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
792 connect(m_contour->ui.intRange, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
793
794 // Texture
795 m_texture->ui.intScale->setRange(0, 100);
797 i18nc("{n} is the number value, % is the percent sign", "{n}%"));
798
799 m_texture->ui.intDepth->setRange(-1000, 1000);
801 i18nc("{n} is the number value, % is the percent sign", "{n}%"));
802
803 connect(m_texture->ui.patternChooser, SIGNAL(resourceSelected(KoResourceSP )), SIGNAL(configChanged()));
804 connect(m_texture->ui.intScale, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
805 connect(m_texture->ui.intDepth, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
806 connect(m_texture->ui.chkInvert, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
807 connect(m_texture->ui.chkLinkWithLayer, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
808}
809
811{
812 ui.cmbStyle->setCurrentIndex((int)bevelAndEmboss->style());
813 ui.cmbTechnique->setCurrentIndex((int)bevelAndEmboss->technique());
814 ui.intDepth->setValue(bevelAndEmboss->depth());
815 ui.cmbDirection->setCurrentIndex((int)bevelAndEmboss->direction());
816 ui.intSize->setValue(bevelAndEmboss->size());
817 ui.intSoften->setValue(bevelAndEmboss->soften());
818
819 ui.angleSelector->setValue(bevelAndEmboss->angle());
820 ui.angleSelector->setUseGlobalLight(bevelAndEmboss->useGlobalLight());
821
822 ui.intAltitude->setValue(bevelAndEmboss->altitude());
823 // FIXME: curve editing
824 // ui.cmbContour;
825 ui.chkAntiAliased->setChecked(bevelAndEmboss->glossAntiAliased());
826 ui.cmbHighlightMode->selectCompositeOp(KoID(bevelAndEmboss->highlightBlendMode()));
827 ui.bnHighlightColor->setColor(bevelAndEmboss->highlightColor());
828 ui.intOpacity->setValue(bevelAndEmboss->highlightOpacity());
829 ui.cmbShadowMode->selectCompositeOp(KoID(bevelAndEmboss->shadowBlendMode()));
830 ui.bnShadowColor->setColor(bevelAndEmboss->shadowColor());
831 ui.intOpacity2->setValue(bevelAndEmboss->shadowOpacity());
832
833 // FIXME: curve editing
834 // m_contour->ui.cmbContour;
835 m_contour->ui.chkAntiAliased->setChecked(bevelAndEmboss->antiAliased());
836 m_contour->ui.intRange->setValue(bevelAndEmboss->contourRange());
837
838 m_texture->ui.patternChooser->setCurrentPattern(bevelAndEmboss->texturePattern(KisGlobalResourcesInterface::instance()));
839 m_texture->ui.intScale->setValue(bevelAndEmboss->textureScale());
840 m_texture->ui.intDepth->setValue(bevelAndEmboss->textureDepth());
841 m_texture->ui.chkInvert->setChecked(bevelAndEmboss->textureInvert());
842 m_texture->ui.chkLinkWithLayer->setChecked(bevelAndEmboss->textureAlignWithLayer());
843}
844
846{
847 bevelAndEmboss->setStyle((psd_bevel_style)ui.cmbStyle->currentIndex());
848 bevelAndEmboss->setTechnique((psd_technique_type)ui.cmbTechnique->currentIndex());
849 bevelAndEmboss->setDepth(ui.intDepth->value());
850 bevelAndEmboss->setDirection((psd_direction)ui.cmbDirection->currentIndex());
851 bevelAndEmboss->setSize(ui.intSize->value());
852 bevelAndEmboss->setSoften(ui.intSoften->value());
853
854 bevelAndEmboss->setAngle(ui.angleSelector->value());
855 bevelAndEmboss->setUseGlobalLight(ui.angleSelector->useGlobalLight());
856 bevelAndEmboss->setAltitude(ui.intAltitude->value());
857 bevelAndEmboss->setGlossAntiAliased(ui.chkAntiAliased->isChecked());
858 bevelAndEmboss->setHighlightBlendMode(ui.cmbHighlightMode->selectedCompositeOp().id());
859 bevelAndEmboss->setHighlightColor(ui.bnHighlightColor->color());
860 bevelAndEmboss->setHighlightOpacity(ui.intOpacity->value());
861 bevelAndEmboss->setShadowBlendMode(ui.cmbShadowMode->selectedCompositeOp().id());
862 bevelAndEmboss->setShadowColor(ui.bnShadowColor->color());
863 bevelAndEmboss->setShadowOpacity(ui.intOpacity2->value());
864
865 // FIXME: curve editing
866 bevelAndEmboss->setAntiAliased(m_contour->ui.chkAntiAliased->isChecked());
867 bevelAndEmboss->setContourRange(m_contour->ui.intRange->value());
868
869 bevelAndEmboss->setTexturePattern(m_texture->ui.patternChooser->currentResource(true).staticCast<KoPattern>());
870 bevelAndEmboss->setTextureScale(m_texture->ui.intScale->value());
871 bevelAndEmboss->setTextureDepth(m_texture->ui.intDepth->value());
872 bevelAndEmboss->setTextureInvert(m_texture->ui.chkInvert->isChecked());
873 bevelAndEmboss->setTextureAlignWithLayer(m_texture->ui.chkLinkWithLayer->isChecked());
874}
875
876
877/********************************************************************/
878/***** Texture *********************************************/
879/********************************************************************/
880
881Texture::Texture(QWidget *parent)
882 : QWidget(parent)
883{
884 ui.setupUi(this);
885}
886
887/********************************************************************/
888/***** Contour *********************************************/
889/********************************************************************/
890
891Contour::Contour(QWidget *parent)
892 : QWidget(parent)
893{
894 ui.setupUi(this);
895}
896
897
898/********************************************************************/
899/***** Blending Options *********************************************/
900/********************************************************************/
901
903 : QWidget(parent)
904{
905 ui.setupUi(this);
906
907 // FIXME: Blend options are not implemented yet
908 ui.grpBlendingOptions->setTitle(QString("%1 (%2)").arg(ui.grpBlendingOptions->title()).arg(i18n("Not Implemented Yet")));
909 ui.grpBlendingOptions->setEnabled(false);
910
911}
912
913
914/********************************************************************/
915/***** Color Overlay *********************************************/
916/********************************************************************/
917
918
920 : QWidget(parent)
921{
922 ui.setupUi(this);
923
924 ui.intOpacity->setRange(0, 100);
925 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
926
927 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
928 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
929 connect(ui.bnColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
930}
931
933{
934 ui.cmbCompositeOp->selectCompositeOp(KoID(colorOverlay->blendMode()));
935 ui.intOpacity->setValue(colorOverlay->opacity());
936 ui.bnColor->setColor(colorOverlay->color());
937}
938
940{
941 colorOverlay->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
942 colorOverlay->setOpacity(ui.intOpacity->value());
943 colorOverlay->setColor(ui.bnColor->color());
944}
945
946
947/********************************************************************/
948/***** Drop Shadow **************************************************/
949/********************************************************************/
950
951DropShadow::DropShadow(Mode mode, QWidget *parent)
952 : QWidget(parent),
953 m_mode(mode)
954{
955 ui.setupUi(this);
956
957 ui.intOpacity->setRange(0, 100);
958 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
959
960 ui.intDistance->setRange(0, 500);
961 ui.intDistance->setSuffix(i18n(" px"));
962 ui.intDistance->setExponentRatio(3.0);
963
964 ui.intSpread->setRange(0, 100);
965 KisSpinBoxI18nHelper::setText(ui.intSpread, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
966
967 ui.intSize->setRange(0, 250);
968 ui.intSize->setSuffix(i18n(" px"));
969 ui.intSize->setExponentRatio(2.0);
970
971 ui.intNoise->setRange(0, 100);
972 KisSpinBoxI18nHelper::setText(ui.intNoise, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
973
974 ui.angleSelector->enableGlobalLight(true);
975 connect(ui.angleSelector, SIGNAL(globalAngleChanged(int)), SIGNAL(globalAngleChanged(int)));
976 connect(ui.angleSelector, SIGNAL(configChanged()), SIGNAL(configChanged()));
977
978 // connect everything to configChanged() signal
979 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
980 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
981 connect(ui.bnColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
982
983 connect(ui.intDistance, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
984 connect(ui.intSpread, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
985 connect(ui.intSize, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
986
987 connect(ui.cmbContour, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
988 connect(ui.chkAntiAliased, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
989 connect(ui.intNoise, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
990
991 connect(ui.chkLayerKnocksOutDropShadow, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
992
993 if (m_mode == InnerShadowMode) {
994 ui.chkLayerKnocksOutDropShadow->setVisible(false);
995 ui.grpMain->setTitle(i18n("Inner Shadow"));
996 ui.lblSpread->setText(i18n("Choke:"));
997 }
998}
999
1001{
1002 ui.cmbCompositeOp->selectCompositeOp(KoID(shadow->blendMode()));
1003 ui.intOpacity->setValue(shadow->opacity());
1004 ui.bnColor->setColor(shadow->color());
1005
1006 ui.angleSelector->setValue(shadow->angle());
1007 ui.angleSelector->setUseGlobalLight(shadow->useGlobalLight());
1008
1009 ui.intDistance->setValue(shadow->distance());
1010 ui.intSpread->setValue(shadow->spread());
1011 ui.intSize->setValue(shadow->size());
1012
1013 // FIXME: curve editing
1014 // ui.cmbContour;
1015 ui.chkAntiAliased->setChecked(shadow->antiAliased());
1016
1017 ui.intNoise->setValue(shadow->noise());
1018
1019 if (m_mode == DropShadowMode) {
1020 const psd_layer_effects_drop_shadow *realDropShadow = dynamic_cast<const psd_layer_effects_drop_shadow*>(shadow);
1021 KIS_ASSERT_RECOVER_NOOP(realDropShadow);
1022
1023 ui.chkLayerKnocksOutDropShadow->setChecked(shadow->knocksOut());
1024 }
1025}
1026
1028{
1029 shadow->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1030 shadow->setOpacity(ui.intOpacity->value());
1031 shadow->setColor(ui.bnColor->color());
1032
1033 shadow->setAngle(ui.angleSelector->value());
1034 shadow->setUseGlobalLight(ui.angleSelector->useGlobalLight());
1035
1036 shadow->setDistance(ui.intDistance->value());
1037 shadow->setSpread(ui.intSpread->value());
1038 shadow->setSize(ui.intSize->value());
1039
1040 // FIXME: curve editing
1041 // ui.cmbContour;
1042 shadow->setAntiAliased(ui.chkAntiAliased->isChecked());
1043 shadow->setNoise(ui.intNoise->value());
1044
1045 if (m_mode == DropShadowMode) {
1046 psd_layer_effects_drop_shadow *realDropShadow = dynamic_cast<psd_layer_effects_drop_shadow*>(shadow);
1047 KIS_ASSERT_RECOVER_NOOP(realDropShadow);
1048
1049 realDropShadow->setKnocksOut(ui.chkLayerKnocksOutDropShadow->isChecked());
1050 }
1051}
1052
1054{
1055public:
1057 return gradient ? KoAbstractGradientSP(gradient->clone().dynamicCast<KoAbstractGradient>()) : KoAbstractGradientSP();
1058 }
1059
1061 if (!gradient) return 0;
1062
1064 KoAbstractGradientSP resource = server->resource(gradient->md5Sum(), "", "");
1065
1066 if (!resource) {
1067 KoAbstractGradientSP clone = gradient->clone().dynamicCast<KoAbstractGradient>();
1068 clone->setName(findAvailableName(gradient->name()));
1069 server->addResource(clone, false);
1070 resource = clone;
1071 }
1072
1073 return resource;
1074 }
1075
1076private:
1077 static QString findAvailableName(const QString &name) {
1079 QString newName = name;
1080 int i = 0;
1081
1082 while (server->resource("", "", newName)) {
1083 newName = QString("%1%2").arg(name).arg(i++);
1084 }
1085
1086 return newName;
1087 }
1088};
1089
1090/********************************************************************/
1091/***** Gradient Overlay *********************************************/
1092/********************************************************************/
1093
1095 : QWidget(parent),
1096 m_resourceProvider(resourceProvider)
1097{
1098 ui.setupUi(this);
1099
1100 ui.intOpacity->setRange(0, 100);
1101 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1102
1103 ui.intScale->setRange(0, 100);
1104 KisSpinBoxI18nHelper::setText(ui.intScale, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1105
1106 ui.angleSelector->angleSelector()->setResetAngle(90.0);
1107
1108 ui.cmbGradient->setCanvasResourcesInterface(resourceProvider->resourceManager()->canvasResourcesInterface());
1109
1110 connect(ui.angleSelector, SIGNAL(configChanged()), SIGNAL(configChanged()));
1111 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1112 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1113 connect(ui.cmbGradient, SIGNAL(gradientChanged(KoAbstractGradientSP)), SIGNAL(configChanged()));
1114 connect(ui.chkReverse, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1115 connect(ui.cmbStyle, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1116 connect(ui.chkAlignWithLayer, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1117 connect(ui.intScale, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1118 connect(ui.chkDither, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1119}
1120
1122{
1123 ui.cmbCompositeOp->selectCompositeOp(KoID(config->blendMode()));
1124 ui.intOpacity->setValue(config->opacity());
1125
1127
1128 if (gradient) {
1129 ui.cmbGradient->setGradient(gradient);
1130 }
1131
1132 ui.chkReverse->setChecked(config->reverse());
1133 ui.cmbStyle->setCurrentIndex((int)config->style());
1134 ui.chkAlignWithLayer->setChecked(config->alignWithLayer());
1135 ui.chkAlignWithLayer->setCheckable(true);
1136 ui.angleSelector->setValue(config->angle());
1137 ui.intScale->setValue(config->scale());
1138 ui.chkDither->setChecked(config->dither());
1139}
1140
1142{
1143 config->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1144 config->setOpacity(ui.intOpacity->value());
1145 KoAbstractGradientSP gradient = ui.cmbGradient->gradient(true);
1146 if (gradient) {
1148 }
1149 config->setReverse(ui.chkReverse->isChecked());
1150 config->setStyle((psd_gradient_style)ui.cmbStyle->currentIndex());
1151 config->setAlignWithLayer(ui.chkAlignWithLayer->isChecked());
1152 config->setAngle(ui.angleSelector->value());
1153 config->setScale(ui.intScale->value());
1154 config->setDither(ui.chkDither->isChecked());
1155}
1156
1157
1158/********************************************************************/
1159/***** Inner Glow **********************************************/
1160/********************************************************************/
1161
1162InnerGlow::InnerGlow(Mode mode, KisCanvasResourceProvider *resourceProvider, QWidget *parent)
1163 : QWidget(parent),
1164 m_mode(mode),
1165 m_resourceProvider(resourceProvider)
1166{
1167 ui.setupUi(this);
1168
1169 if (mode == OuterGlowMode) {
1170 ui.groupBox->setTitle(i18n("Outer Glow"));
1171 }
1172
1173 ui.intOpacity->setRange(0, 100);
1174 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1175
1176 ui.intNoise->setRange(0, 100);
1177 KisSpinBoxI18nHelper::setText(ui.intNoise, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1178
1179 ui.intChoke->setRange(0, 100);
1180 KisSpinBoxI18nHelper::setText(ui.intChoke, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1181
1182 ui.intSize->setRange(0, 250);
1183 ui.intSize->setSuffix(i18n(" px"));
1184 ui.intSize->setExponentRatio(2.0);
1185
1186 ui.intRange->setRange(1, 100);
1187 KisSpinBoxI18nHelper::setText(ui.intRange, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1188
1189 ui.intJitter->setRange(0, 100);
1190 KisSpinBoxI18nHelper::setText(ui.intJitter, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1191
1192 ui.cmbGradient->setCanvasResourcesInterface(resourceProvider->resourceManager()->canvasResourcesInterface());
1193
1194 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1195 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1196 connect(ui.intNoise, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1197
1198 connect(ui.radioColor, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1199 connect(ui.bnColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
1200 connect(ui.radioGradient, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1201 connect(ui.cmbGradient, SIGNAL(gradientChanged(KoAbstractGradientSP)), SIGNAL(configChanged()));
1202
1203 connect(ui.cmbTechnique, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1204 connect(ui.cmbSource, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1205 connect(ui.intChoke, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1206 connect(ui.intSize, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1207
1208 connect(ui.cmbContour, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1209 connect(ui.chkAntiAliased, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1210 connect(ui.intRange, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1211 connect(ui.intJitter, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1212
1213 if (m_mode == OuterGlowMode) {
1214 ui.cmbSource->hide();
1215 ui.lblSource->hide();
1216 ui.lblChoke->setText(i18nc("layer styles parameter", "Spread:"));
1217 }
1218
1219}
1220
1222{
1223 ui.cmbCompositeOp->selectCompositeOp(KoID(config->blendMode()));
1224 ui.intOpacity->setValue(config->opacity());
1225 ui.intNoise->setValue(config->noise());
1226
1227 ui.radioColor->setChecked(config->fillType() == psd_fill_solid_color);
1228 ui.bnColor->setColor(config->color());
1229 ui.radioGradient->setChecked(config->fillType() == psd_fill_gradient);
1230
1232
1233 if (gradient) {
1234 ui.cmbGradient->setGradient(gradient);
1235 }
1236
1237 ui.cmbTechnique->setCurrentIndex((int)config->technique());
1238 ui.intChoke->setValue(config->spread());
1239 ui.intSize->setValue(config->size());
1240
1241 if (m_mode == InnerGlowMode) {
1242 const psd_layer_effects_inner_glow *iglow =
1243 dynamic_cast<const psd_layer_effects_inner_glow *>(config);
1245
1246 ui.cmbSource->setCurrentIndex(iglow->source() == psd_glow_edge);
1247 }
1248
1249 // FIXME: Curve editing
1250 //ui.cmbContour;
1251
1252 ui.chkAntiAliased->setChecked(config->antiAliased());
1253 ui.intRange->setValue(config->range());
1254 ui.intJitter->setValue(config->jitter());
1255}
1256
1258{
1259 config->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1260 config->setOpacity(ui.intOpacity->value());
1261 config->setNoise(ui.intNoise->value());
1262
1263 if (ui.radioColor->isChecked()) {
1265 }
1266 else {
1268 }
1269
1270 config->setColor(ui.bnColor->color());
1271 KoAbstractGradientSP gradient = ui.cmbGradient->gradient(true);
1272 if (gradient) {
1274 }
1275 config->setTechnique((psd_technique_type)ui.cmbTechnique->currentIndex());
1276 config->setSpread(ui.intChoke->value());
1277 config->setSize(ui.intSize->value());
1278
1279 if (m_mode == InnerGlowMode) {
1281 dynamic_cast<psd_layer_effects_inner_glow *>(config);
1283
1284 iglow->setSource((psd_glow_source)ui.cmbSource->currentIndex());
1285 }
1286
1287 // FIXME: Curve editing
1288 //ui.cmbContour;
1289
1290 config->setAntiAliased(ui.chkAntiAliased->isChecked());
1291 config->setRange(ui.intRange->value());
1292 config->setJitter(ui.intJitter->value());
1293}
1294
1295
1296/********************************************************************/
1297/***** Pattern Overlay *********************************************/
1298/********************************************************************/
1299
1300
1302 : QWidget(parent)
1303{
1304 ui.setupUi(this);
1305
1306 ui.intOpacity->setRange(0, 100);
1307 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1308
1309 ui.intScale->setRange(0, 100);
1310 KisSpinBoxI18nHelper::setText(ui.intScale, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1311
1312 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1313 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1314 connect(ui.patternChooser, SIGNAL(resourceSelected(KoResourceSP )), SIGNAL(configChanged()));
1315 connect(ui.chkLinkWithLayer, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1316 connect(ui.intScale, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1317}
1318
1320{
1321 ui.cmbCompositeOp->selectCompositeOp(KoID(pattern->blendMode()));
1322 ui.intOpacity->setValue(pattern->opacity());
1323 KoPatternSP patternResource = pattern->pattern(KisGlobalResourcesInterface::instance());
1324 ui.patternChooser->setCurrentPattern(patternResource);
1325 ui.chkLinkWithLayer->setChecked(pattern->alignWithLayer());
1326 ui.intScale->setValue(pattern->scale());
1327}
1328
1330{
1331 pattern->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1332 pattern->setOpacity(ui.intOpacity->value());
1333 pattern->setPattern(ui.patternChooser->currentResource(true).staticCast<KoPattern>());
1334 pattern->setAlignWithLayer(ui.chkLinkWithLayer->isChecked());
1335 pattern->setScale(ui.intScale->value());
1336}
1337
1338/********************************************************************/
1339/***** Satin *********************************************/
1340/********************************************************************/
1341
1342
1343Satin::Satin(QWidget *parent)
1344 : QWidget(parent)
1345{
1346 ui.setupUi(this);
1347
1348 ui.intOpacity->setRange(0, 100);
1349 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1350
1351 ui.intDistance->setRange(0, 250);
1352 ui.intDistance->setSuffix(i18n(" px"));
1353
1354 ui.intSize->setRange(0, 250);
1355 ui.intSize->setSuffix(i18n(" px"));
1356 ui.intSize->setExponentRatio(2.0);
1357
1358 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1359 connect(ui.bnColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
1360 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1361
1362 connect(ui.angleSelector, SIGNAL(configChanged()), SIGNAL(configChanged()));
1363 connect(ui.intDistance, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1364 connect(ui.intSize, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1365
1366 connect(ui.cmbContour, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1367 connect(ui.chkAntiAliased, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1368 connect(ui.chkInvert, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1369
1370}
1371
1373{
1374 ui.cmbCompositeOp->selectCompositeOp(KoID(satin->blendMode()));
1375 ui.bnColor->setColor(satin->color());
1376 ui.intOpacity->setValue(satin->opacity());
1377
1378 ui.angleSelector->setValue(satin->angle());
1379
1380 ui.intDistance->setValue(satin->distance());
1381 ui.intSize->setValue(satin->size());
1382
1383 // FIXME: Curve editing
1384 //ui.cmbContour;
1385
1386 ui.chkAntiAliased->setChecked(satin->antiAliased());
1387 ui.chkInvert->setChecked(satin->invert());
1388
1389}
1390
1392{
1393 satin->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1394 satin->setOpacity(ui.intOpacity->value());
1395 satin->setColor(ui.bnColor->color());
1396
1397 satin->setAngle(ui.angleSelector->value());
1398
1399 satin->setDistance(ui.intDistance->value());
1400 satin->setSize(ui.intSize->value());
1401
1402 // FIXME: curve editing
1403 // ui.cmbContour;
1404 satin->setAntiAliased(ui.chkAntiAliased->isChecked());
1405 satin->setInvert(ui.chkInvert->isChecked());
1406}
1407
1408/********************************************************************/
1409/***** Stroke *********************************************/
1410/********************************************************************/
1411
1412Stroke::Stroke(KisCanvasResourceProvider *resourceProvider, QWidget *parent)
1413 : QWidget(parent),
1414 m_resourceProvider(resourceProvider)
1415{
1416 ui.setupUi(this);
1417
1418 ui.intSize->setRange(0, 250);
1419 ui.intSize->setSuffix(i18n(" px"));
1420 ui.intSize->setExponentRatio(2.0);
1421
1422 ui.intOpacity->setRange(0, 100);
1423 KisSpinBoxI18nHelper::setText(ui.intOpacity, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1424
1425 ui.intScale->setRange(0, 100);
1426 KisSpinBoxI18nHelper::setText(ui.intScale, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1427
1428 ui.intScale_2->setRange(0, 100);
1429 KisSpinBoxI18nHelper::setText(ui.intScale_2, i18nc("{n} is the number value, % is the percent sign", "{n}%"));
1430
1431 ui.cmbGradient->setCanvasResourcesInterface(resourceProvider->resourceManager()->canvasResourcesInterface());
1432
1433 connect(ui.cmbFillType, SIGNAL(currentIndexChanged(int)), ui.fillStack, SLOT(setCurrentIndex(int)));
1434
1435 connect(ui.intSize, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1436 connect(ui.cmbPosition, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1437 connect(ui.cmbCompositeOp, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1438 connect(ui.intOpacity, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1439
1440 connect(ui.cmbFillType, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1441
1442 connect(ui.bnColor, SIGNAL(changed(KoColor)), SIGNAL(configChanged()));
1443
1444 connect(ui.cmbGradient, SIGNAL(gradientChanged(KoAbstractGradientSP)), SIGNAL(configChanged()));
1445 connect(ui.chkReverse, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1446 connect(ui.cmbStyle, SIGNAL(currentIndexChanged(int)), SIGNAL(configChanged()));
1447 connect(ui.chkAlignWithLayer, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1448 connect(ui.intScale, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1449
1450 connect(ui.patternChooser, SIGNAL(resourceSelected(KoResourceSP )), SIGNAL(configChanged()));
1451 connect(ui.angleSelector, SIGNAL(configChanged()), SIGNAL(configChanged()));
1452
1453 connect(ui.chkLinkWithLayer, SIGNAL(toggled(bool)), SIGNAL(configChanged()));
1454 connect(ui.intScale_2, SIGNAL(valueChanged(int)), SIGNAL(configChanged()));
1455
1456 // cold initialization
1457 ui.fillStack->setCurrentIndex(ui.cmbFillType->currentIndex());
1458}
1459
1461{
1462 ui.intSize->setValue(stroke->size());
1463 ui.cmbPosition->setCurrentIndex((int)stroke->position());
1464 ui.cmbCompositeOp->selectCompositeOp(KoID(stroke->blendMode()));
1465 ui.intOpacity->setValue(stroke->opacity());
1466
1467 ui.cmbFillType->setCurrentIndex((int)stroke->fillType());
1468 ui.bnColor->setColor(stroke->color());
1469
1471
1472 if (gradient) {
1473 ui.cmbGradient->setGradient(gradient);
1474 }
1475
1476 ui.chkReverse->setChecked(stroke->antiAliased());
1477 ui.cmbStyle->setCurrentIndex((int)stroke->style());
1478 ui.chkAlignWithLayer->setChecked(stroke->alignWithLayer());
1479 ui.chkAlignWithLayer->setCheckable(true);
1480 ui.angleSelector->setValue(stroke->angle());
1481 ui.intScale->setValue(stroke->scale());
1482
1483 ui.patternChooser->setCurrentPattern(stroke->pattern(KisGlobalResourcesInterface::instance()));
1484 ui.chkLinkWithLayer->setChecked(stroke->alignWithLayer());
1485 ui.intScale_2->setValue(stroke->scale());
1486}
1487
1489{
1490 stroke->setSize(ui.intSize->value());
1491 stroke->setPosition((psd_stroke_position)ui.cmbPosition->currentIndex());
1492 stroke->setBlendMode(ui.cmbCompositeOp->selectedCompositeOp().id());
1493 stroke->setOpacity(ui.intOpacity->value());
1494
1495 psd_fill_type fillType = (psd_fill_type)ui.cmbFillType->currentIndex();
1496 stroke->setFillType(fillType);
1497
1498 stroke->setColor(ui.bnColor->color());
1499
1500 KoAbstractGradientSP gradient = ui.cmbGradient->gradient(true);
1501 if (gradient) {
1503 }
1504
1505 stroke->setReverse(ui.chkReverse->isChecked());
1506 stroke->setStyle((psd_gradient_style)ui.cmbStyle->currentIndex());
1507 if (fillType == psd_fill_gradient) {
1508 // there is only one boolean value, and it's shared with pattern's "link with layer"
1509 stroke->setAlignWithLayer(ui.chkAlignWithLayer->isChecked());
1510 }
1511 stroke->setAngle(ui.angleSelector->value());
1512 stroke->setScale(ui.intScale->value());
1513
1514 stroke->setPattern(ui.patternChooser->currentResource(true).staticCast<KoPattern>());
1515 if (fillType == psd_fill_pattern) {
1516 // there is only one boolean value, and it's shared with gradient's "align with layer"
1517 stroke->setAlignWithLayer(ui.chkLinkWithLayer->isChecked());
1518 }
1519 stroke->setScale(ui.intScale->value());
1520}
float value(const T *src, size_t ch)
QList< QString > QStringList
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void fetchBevelAndEmboss(psd_layer_effects_bevel_emboss *bevelAndEmboss) const
void setBevelAndEmboss(const psd_layer_effects_bevel_emboss *bevelAndEmboss)
BevelAndEmboss(Contour *contour, Texture *texture, QWidget *parent)
Ui::WdgBevelAndEmboss ui
void globalAngleChanged(int value)
void configChanged()
Ui::WdgBlendingOptions ui
BlendingOptions(QWidget *parent)
ColorOverlay(QWidget *parent)
void setColorOverlay(const psd_layer_effects_color_overlay *colorOverlay)
Ui::WdgColorOverlay ui
void configChanged()
void fetchColorOverlay(psd_layer_effects_color_overlay *colorOverlay) const
Ui::WdgContour ui
Contour(QWidget *parent)
Ui::WdgDropShadow ui
void globalAngleChanged(int value)
void setShadow(const psd_layer_effects_shadow_common *shadow)
void fetchShadow(psd_layer_effects_shadow_common *shadow) const
void configChanged()
DropShadow(Mode mode, QWidget *parent)
Ui::WdgGradientOverlay ui
KisCanvasResourceProvider * m_resourceProvider
void setGradientOverlay(const psd_layer_effects_gradient_overlay *gradient)
GradientOverlay(KisCanvasResourceProvider *resourceProvider, QWidget *parent)
void fetchGradientOverlay(psd_layer_effects_gradient_overlay *gradient) const
void configChanged()
static KoAbstractGradientSP styleToResource(KoAbstractGradientSP gradient)
static KoAbstractGradientSP resourceToStyle(KoAbstractGradientSP gradient)
static QString findAvailableName(const QString &name)
InnerGlow(Mode mode, KisCanvasResourceProvider *resourceProvider, QWidget *parent)
Ui::WdgInnerGlow ui
void fetchConfig(psd_layer_effects_glow_common *innerGlow) const
void configChanged()
void setConfig(const psd_layer_effects_glow_common *innerGlow)
KisCanvasResourceProvider * m_resourceProvider
void setStyles(const QVector< KisPSDLayerStyleSP > &styles)
bool saveToFile(const QString &filename)
KoCanvasResourceProvider * resourceManager()
KoAbstractGradientSP currentGradient() const
T readEntry(const QString &name, const T &defaultValue=T())
Definition kis_config.h:789
void changePage(QListWidgetItem *, QListWidgetItem *)
KisDlgLayerStyle(KisPSDLayerStyleSP layerStyle, KisCanvasResourceProvider *resourceProvider, QWidget *parent=0)
KisPSDLayerStyleSP m_initialLayerStyle
void slotMasterFxSwitchChanged(bool value)
BevelAndEmboss * m_bevelAndEmboss
PatternOverlay * m_patternOverlay
GradientOverlay * m_gradientOverlay
Ui::WdgStylesDialog wdgLayerStyles
BlendingOptions * m_blendingOptions
void slotBevelAndEmbossChanged(QListWidgetItem *)
void syncGlobalAngle(int angle)
ColorOverlay * m_colorOverlay
void setStyle(KisPSDLayerStyleSP style)
KisPSDLayerStyleSP style() const
KisPSDLayerStyleSP m_layerStyle
void notifyPredefinedStyleSelected(KisPSDLayerStyleSP style)
StylesSelector * m_stylesSelector
KisSignalCompressor * m_configChangedCompressor
static KisResourcesInterfaceSP instance()
bool addStorage(const QString &storageLocation, KisResourceStorageSP storage)
addStorage Adds a new resource storage to the database. The storage is will be marked as not pre-inst...
static KisResourceLocator * instance()
The KisResourceModel class provides the main access to resources. It is possible to filter the resour...
KoResourceSP resourceForId(int id) const
QModelIndex indexForResource(KoResourceSP resource) const override
indexFromResource
KoResourceSP resourceForIndex(QModelIndex index=QModelIndex()) const override
resourceForIndex returns a properly versioned and id'ed resource object
static KisResourceServerProvider * instance()
KoResourceServer< KisPSDLayerStyle > * layerStyleServer()
static bool addResourceWithUserInput(QWidget *widgetParent, KoResourceSP resource, QString storageLocation="")
KoCanvasResourcesInterfaceSP canvasResourcesInterface() const
A dialog base class with standard buttons and predefined layouts.
Definition KoDialog.h:116
void setMainWidget(QWidget *widget)
Definition KoDialog.cpp:354
virtual void setCaption(const QString &caption)
Definition KoDialog.cpp:498
void setButtons(ButtonCodes buttonMask)
Definition KoDialog.cpp:195
void setDefaultButton(ButtonCode id)
Definition KoDialog.cpp:302
@ Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)
Definition KoDialog.h:127
@ Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)
Definition KoDialog.h:130
Definition KoID.h:30
Write API docs here.
Definition KoPattern.h:21
static QString getAppDataLocation()
QSharedPointer< T > resource(const QString &md5, const QString &fileName, const QString &name)
resource retrieves a resource. If the md5sum is not empty, the resource will only be retrieved if a r...
bool addResource(QSharedPointer< T > resource, bool save=true)
Adds an already loaded resource to the server.
PatternOverlay(QWidget *parent)
void fetchPatternOverlay(psd_layer_effects_pattern_overlay *pattern) const
void configChanged()
void setPatternOverlay(const psd_layer_effects_pattern_overlay *pattern)
Ui::WdgPatternOverlay ui
Satin(QWidget *parent)
void configChanged()
void setSatin(const psd_layer_effects_satin *satin)
Ui::WdgSatin ui
void fetchSatin(psd_layer_effects_satin *satin) const
void configChanged()
void fetchStroke(psd_layer_effects_stroke *stroke) const
Stroke(KisCanvasResourceProvider *resourceProvider, QWidget *parent)
KisCanvasResourceProvider * m_resourceProvider
Ui::WdgStroke ui
void setStroke(const psd_layer_effects_stroke *stroke)
KisPSDLayerStyleSP m_style
StyleItem(KisPSDLayerStyleSP style)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
void setEnableFiltering(bool enableFiltering)
void addNewStyle(const QString &location, const KisPSDLayerStyleSP style)
void notifyExternalStyleChanged(const QString &name, const QUuid &uuid)
void loadStyles(const QString &name)
void loadCollection(const QString &fileName)
void selectStyle(QModelIndex current)
StylesSelector(QWidget *parent)
Ui::WdgStylesSelector ui
void styleSelected(KisPSDLayerStyleSP style)
LocationProxyModel * m_locationsProxyModel
KisResourceModel * m_resourceModel
Texture(QWidget *parent)
Ui::WdgTexture ui
void setSource(psd_glow_source value)
Definition psd.h:610
psd_glow_source source() const
Definition psd.h:606
qint32 opacity() const
Definition psd.h:281
void setGradient(KoAbstractGradientSP value)
Definition psd.h:467
qint32 range() const
Definition psd.h:351
void setColor(KoColor value)
Definition psd.h:377
void setRange(qint32 value)
Definition psd.h:457
qint32 distance() const
Definition psd.h:296
bool useGlobalLight() const
Definition psd.h:291
QString blendMode() const
Definition psd.h:266
void setFillType(psd_fill_type value)
Definition psd.h:447
void setNoise(qint32 value)
Definition psd.h:427
bool knocksOut() const
Definition psd.h:326
void setUseGlobalLight(bool value)
Definition psd.h:397
qint32 spread() const
Definition psd.h:301
psd_technique_type technique() const
Definition psd.h:346
KoColor color() const
Definition psd.h:271
qint32 jitter() const
Definition psd.h:356
qint32 noise() const
Definition psd.h:321
void setTechnique(psd_technique_type value)
Definition psd.h:452
void setAntiAliased(bool value)
Definition psd.h:422
void setKnocksOut(bool value)
Definition psd.h:432
void setDistance(qint32 value)
Definition psd.h:402
void setAngle(qint32 value)
Definition psd.h:392
qint32 angle() const
Definition psd.h:286
qint32 size() const
Definition psd.h:306
KoAbstractGradientSP gradient(KisResourcesInterfaceSP resourcesInterface) const
Definition psd.h:365
void setBlendMode(QString value)
Definition psd.h:372
void setJitter(qint32 value)
Definition psd.h:462
void setOpacity(qint32 value)
Definition psd.h:387
psd_fill_type fillType() const
Definition psd.h:341
bool antiAliased() const
Definition psd.h:316
void setSpread(qint32 value)
Definition psd.h:407
void setSize(qint32 value)
Definition psd.h:412
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97
#define KIS_ASSERT(cond)
Definition kis_assert.h:33
QSharedPointer< KoAbstractGradient > KoAbstractGradientSP
Definition kis_brush.h:28
#define warnKrita
Definition kis_debug.h:87
#define ENTER_FUNCTION()
Definition kis_debug.h:178
bool checkCustomNameAvailable(const QString &name)
KoAbstractGradientSP fetchGradientLazy(KoAbstractGradientSP gradient, KisCanvasResourceProvider *resourceProvider)
QString createNewAslPath(QString resourceFolderPath, QString filename)
QString selectAvailableStyleName(const QString &name)
void setText(QSpinBox *spinBox, const QStringView textTemplate)
const QString LayerStyles
rgba palette[MAX_PALETTE]
Definition palette.c:35
psd_glow_source
Definition psd.h:129
@ psd_glow_edge
Definition psd.h:131
psd_direction
Definition psd.h:142
psd_gradient_style
Definition psd.h:101
psd_fill_type
Definition psd.h:123
@ psd_fill_solid_color
Definition psd.h:124
@ psd_fill_gradient
Definition psd.h:125
@ psd_fill_pattern
Definition psd.h:126
psd_technique_type
Definition psd.h:115
psd_bevel_style
Definition psd.h:134
psd_stroke_position
Definition psd.h:121
The KisPSDLayerStyle class implements loading, saving and applying the PSD layer effects.
static KoResourceServerProvider * instance()
KoResourceServer< KoAbstractGradient > * gradientServer
QString filename
QString md5Sum(bool generateIfEmpty=true) const
void setTechnique(psd_technique_type value)
Definition psd.h:734
void setStyle(psd_bevel_style value)
Definition psd.h:725
void setTextureDepth(int value)
Definition psd.h:907
QString shadowBlendMode() const
Definition psd.h:821
psd_technique_type technique() const
Definition psd.h:730
void setShadowColor(KoColor value)
Definition psd.h:834
qint32 highlightOpacity() const
Definition psd.h:812
psd_bevel_style style() const
Definition psd.h:721
void setTextureScale(int value)
Definition psd.h:898
psd_direction direction() const
Definition psd.h:748
bool glossAntiAliased() const
Definition psd.h:785
void setDirection(psd_direction value)
Definition psd.h:752
KoPatternSP texturePattern(KisResourcesInterfaceSP resourcesInterface) const
Definition psd.h:879
void setTexturePattern(KoPatternSP value)
Definition psd.h:885
void setHighlightBlendMode(QString value)
Definition psd.h:798
void setAltitude(int value)
Definition psd.h:770
bool textureInvert() const
Definition psd.h:912
void setHighlightColor(KoColor value)
Definition psd.h:807
void setContourRange(int value)
Definition psd.h:861
qint32 shadowOpacity() const
Definition psd.h:839
bool textureAlignWithLayer() const
Definition psd.h:921
void setShadowBlendMode(QString value)
Definition psd.h:825
void setDepth(int value)
Definition psd.h:743
QString highlightBlendMode() const
Definition psd.h:794
void setGlossAntiAliased(bool value)
Definition psd.h:789
KoColor shadowColor() const
Definition psd.h:830
KoColor highlightColor() const
Definition psd.h:803
void setTextureAlignWithLayer(bool value)
Definition psd.h:925
void setShadowOpacity(qint32 value)
Definition psd.h:843
void setSoften(int value)
Definition psd.h:761
void setTextureInvert(bool value)
Definition psd.h:916
void setHighlightOpacity(qint32 value)
Definition psd.h:816
KoPatternSP pattern(KisResourcesInterfaceSP resourcesInterface) const
Definition psd.h:1061
void setReverse(bool value)
Definition psd.h:1094
void setAlignWithLayer(bool value)
Definition psd.h:1084
void setStyle(psd_gradient_style value)
Definition psd.h:1099
bool alignWithLayer() const
Definition psd.h:1027
void setScale(int value)
Definition psd.h:1079
void setDither(bool value)
Definition psd.h:1089
psd_gradient_style style() const
Definition psd.h:1042
void setPattern(KoPatternSP value)
Definition psd.h:1115
void setInvert(bool value)
Definition psd.h:655
bool invert() const
Definition psd.h:650
void setPosition(psd_stroke_position value)
Definition psd.h:1284
psd_stroke_position position() const
Definition psd.h:1280