Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_custom_brush_widget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2005 Bart Coppens <kde@bartcoppens.be>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_CUSTOM_BRUSH_H_
8#define KIS_CUSTOM_BRUSH_H_
9
10#include <QObject>
11#include <QShowEvent>
12
13#include "ui_wdgcustombrush.h"
14#include <kis_types.h>
15#include <kis_brush.h>
16#include <KoResourceServer.h>
17
18const QString TEMPORARY_FILENAME = "/tmp/temporaryKritaBrush.gbr";
19const QString TEMPORARY_BRUSH_NAME = "Temporary custom brush";
20const double DEFAULT_SPACING = 0.25;
21
22
23class KoResource;
24
25
26class KisWdgCustomBrush : public QDialog, public Ui::KisWdgCustomBrush
27{
28 Q_OBJECT
29
30public:
31 KisWdgCustomBrush(QWidget *parent) : QDialog(parent) {
32 setupUi(this);
33 }
34};
35
37{
38 Q_OBJECT
39public:
40 KisCustomBrushWidget(QWidget *parent, const QString& caption, KisImageWSP image);
41 virtual ~KisCustomBrushWidget();
43
44 void setImage(KisImageWSP image);
45
46protected:
47 void showEvent(QShowEvent *) override;
48
49private Q_SLOTS:
50 void slotAddPredefined();
51 void slotUpdateCurrentBrush(int i = 0); // To connect with activated(int)
52 void slotSpacingChanged();
53 void slotUpdateUseColorAsMask(bool useColorAsMask);
55
56Q_SIGNALS:
58
59private:
60 void createBrush();
61 void updatePreviewImage();
62
65
67};
68
69
70#endif // KIS_CUSTOM_BRUSH_H_
void sigNewPredefinedBrush(KoResourceSP)
void showEvent(QShowEvent *) override
KisCustomBrushWidget(QWidget *parent, const QString &caption, KisImageWSP image)
KoResourceServer< KisBrush > * m_rServer
void slotUpdateUseColorAsMask(bool useColorAsMask)
void setImage(KisImageWSP image)
KisWdgCustomBrush(QWidget *parent)
const QString TEMPORARY_FILENAME
const QString TEMPORARY_BRUSH_NAME
const double DEFAULT_SPACING