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
* SPDX-FileCopyrightText: 2026 Freya Lupen <penguinflyer2222@gmail.com>
4
*
5
* SPDX-License-Identifier: GPL-2.0-or-later
6
*/
7
8
#ifndef KIS_CUSTOM_BRUSH_H_
9
#define KIS_CUSTOM_BRUSH_H_
10
11
#include <QDialog>
12
13
#include "
kis_config_widget.h
"
14
#include "
kis_types.h
"
15
#include "
KoResourceServer.h
"
16
17
class
QLabel;
18
class
QDialogButtonBox;
19
20
class
KisBrush
;
21
22
class
KisCustomBrushWidget
:
public
QDialog
23
{
24
Q_OBJECT
25
public
:
26
KisCustomBrushWidget
(QWidget *parent,
const
QString& caption);
27
virtual
~KisCustomBrushWidget
();
28
29
private
Q_SLOTS:
30
// Swaps the brush widget and reloads the brush.
31
void
slotSourceChanged
(
int
source
);
32
33
void
slotReload
();
34
35
// Exports the brushtip and adds it to the resource server.
36
void
slotAddPredefined
();
37
38
void
slotUpdateSaveButton
();
39
40
// Responds to the the export configuration changing.
41
void
slotUpdateBrush
();
42
43
Q_SIGNALS:
44
void
sigNewPredefinedBrush
(
KoResourceSP
);
45
46
private
:
47
// @returns the brush widget that should be shown according to m_clipboard.
48
KisConfigWidget
*
currentBrushWidget
();
49
50
// @returns the brush widget that should not be shown according to m_clipboard.
51
KisConfigWidget
*
otherBrushWidget
();
52
53
/* Swaps between GBR (non-animated) and GIH (animated) brush widgets.
54
* Clipboard source doesn't support animated and shows the GBR widget,
55
* otherwise the GIH widget allowing animated is shown.
56
*/
57
void
swapBrushWidget
();
58
59
// @returns the current view's image.
60
KisImageWSP
currentImage
();
61
int
currentBrushStyle
();
62
63
// @returns a temporary filepath to export to with the proper filename and extension.
64
QString
fileName
();
65
66
// Caches the device(s) used for the brushtip from the image or clipboard.
67
void
loadImage
();
68
69
/* Updates the preview thumbnail if brush style, use mask, or preserve alpha
70
* have changed, or if updateDev indicates the paint device has changed.
71
* @param updateDev whether the paint device has changed.
72
*/
73
void
updatePreviewImage
(
bool
updateDev);
74
75
QLabel*
m_preview
{
nullptr
};
76
KisConfigWidget
*
m_brushWidget
{
nullptr
};
77
KisConfigWidget
*
m_animBrushWidget
{
nullptr
};
78
QDialogButtonBox*
m_buttonBox
{
nullptr
};
79
80
KisPaintDeviceSP
m_dev
{
nullptr
};
81
QRect
m_devRect
;
82
QVector<QVector<KisPaintDevice*>
>
m_devices
;
83
QSize
m_imageSize
;
84
const
KoColorSpace
*
m_imageColorSpace
;
85
86
KoResourceServer<KisBrush>
*
m_rServer
{0};
87
88
bool
m_useClipboard
{
false
};
89
KisPropertiesConfigurationSP
m_oldConfig
{
nullptr
};
90
};
91
92
93
#endif
// KIS_CUSTOM_BRUSH_H_
source
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
Definition
KisMagneticGraph.h:251
KoResourceServer.h
KisBrush
Definition
kis_brush.h:67
KisConfigWidget
Definition
kis_config_widget.h:31
KisCustomBrushWidget
Definition
kis_custom_brush_widget.h:23
KisCustomBrushWidget::slotReload
void slotReload()
Definition
kis_custom_brush_widget.cpp:258
KisCustomBrushWidget::m_dev
KisPaintDeviceSP m_dev
Definition
kis_custom_brush_widget.h:80
KisCustomBrushWidget::m_oldConfig
KisPropertiesConfigurationSP m_oldConfig
Definition
kis_custom_brush_widget.h:89
KisCustomBrushWidget::currentImage
KisImageWSP currentImage()
Definition
kis_custom_brush_widget.cpp:168
KisCustomBrushWidget::sigNewPredefinedBrush
void sigNewPredefinedBrush(KoResourceSP)
KisCustomBrushWidget::slotSourceChanged
void slotSourceChanged(int source)
Definition
kis_custom_brush_widget.cpp:180
KisCustomBrushWidget::m_useClipboard
bool m_useClipboard
Definition
kis_custom_brush_widget.h:88
KisCustomBrushWidget::slotUpdateSaveButton
void slotUpdateSaveButton()
Definition
kis_custom_brush_widget.cpp:265
KisCustomBrushWidget::m_animBrushWidget
KisConfigWidget * m_animBrushWidget
Definition
kis_custom_brush_widget.h:77
KisCustomBrushWidget::~KisCustomBrushWidget
virtual ~KisCustomBrushWidget()
Definition
kis_custom_brush_widget.cpp:125
KisCustomBrushWidget::swapBrushWidget
void swapBrushWidget()
Definition
kis_custom_brush_widget.cpp:147
KisCustomBrushWidget::m_imageColorSpace
const KoColorSpace * m_imageColorSpace
Definition
kis_custom_brush_widget.h:84
KisCustomBrushWidget::m_buttonBox
QDialogButtonBox * m_buttonBox
Definition
kis_custom_brush_widget.h:78
KisCustomBrushWidget::loadImage
void loadImage()
Definition
kis_custom_brush_widget.cpp:326
KisCustomBrushWidget::currentBrushWidget
KisConfigWidget * currentBrushWidget()
Definition
kis_custom_brush_widget.cpp:129
KisCustomBrushWidget::m_brushWidget
KisConfigWidget * m_brushWidget
Definition
kis_custom_brush_widget.h:76
KisCustomBrushWidget::m_rServer
KoResourceServer< KisBrush > * m_rServer
Definition
kis_custom_brush_widget.h:86
KisCustomBrushWidget::fileName
QString fileName()
Definition
kis_custom_brush_widget.cpp:160
KisCustomBrushWidget::m_preview
QLabel * m_preview
Definition
kis_custom_brush_widget.h:75
KisCustomBrushWidget::slotUpdateBrush
void slotUpdateBrush()
Definition
kis_custom_brush_widget.cpp:199
KisCustomBrushWidget::KisCustomBrushWidget
KisCustomBrushWidget(QWidget *parent, const QString &caption)
Definition
kis_custom_brush_widget.cpp:62
KisCustomBrushWidget::updatePreviewImage
void updatePreviewImage(bool updateDev)
Definition
kis_custom_brush_widget.cpp:212
KisCustomBrushWidget::m_devices
QVector< QVector< KisPaintDevice * > > m_devices
Definition
kis_custom_brush_widget.h:82
KisCustomBrushWidget::m_devRect
QRect m_devRect
Definition
kis_custom_brush_widget.h:81
KisCustomBrushWidget::m_imageSize
QSize m_imageSize
Definition
kis_custom_brush_widget.h:83
KisCustomBrushWidget::currentBrushStyle
int currentBrushStyle()
Definition
kis_custom_brush_widget.cpp:155
KisCustomBrushWidget::slotAddPredefined
void slotAddPredefined()
Definition
kis_custom_brush_widget.cpp:283
KisCustomBrushWidget::otherBrushWidget
KisConfigWidget * otherBrushWidget()
Definition
kis_custom_brush_widget.cpp:138
KisPinnedSharedPtr< KisPropertiesConfiguration >
KisSharedPtr< KisPaintDevice >
KisWeakSharedPtr< KisImage >
KoColorSpace
Definition
KoColorSpace.h:78
KoResourceServer
Definition
KoResourceServer.h:76
QList
Definition
KisQStringListFwd.h:16
QSharedPointer< KoResource >
kis_config_widget.h
kis_types.h
plugins
paintops
libpaintop
kis_custom_brush_widget.h
Generated at
2026-10-16 02:30:01+02:00
from
Krita
branch
master
, commit
2568c1a0ec2a5af697f89c15cc373a490ae7c70d