2
* Copyright (c) 2010 Boudewijn Rempt <boud@valdyas.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
#ifndef KIS_BRUSHENGINE_SELECTOR_H
19
#define KIS_BRUSHENGINE_SELECTOR_H
26
#include <kpagedialog.h>
29
#include <KoInputDevice.h>
31
#include <kis_types.h>
32
#include <kis_paintop_settings.h>
36
class KisCanvasResourceProvider;
37
class KisPaintOpSettingsWidget;
38
class KisPaintOpPresetsChooserPopup;
40
class KisPaintOpPresetsPopup;
43
class KisBrushEngineSelector : public QWidget
47
Q_DISABLE_COPY(KisBrushEngineSelector)
51
explicit KisBrushEngineSelector(KisView2 * view, QWidget *parent = 0);
52
~KisBrushEngineSelector();
54
KisPaintOpPresetSP paintOpPresetSP(KoID * = 0);
55
const KoID & currentPaintop();
56
void setCurrentPaintop(const KoID & paintop);
57
QPixmap paintopPixmap(const KoID & paintop);
61
void signalPaintopChanged(KisPaintOpPresetSP paintop);
65
void contextMenuEvent(QContextMenuEvent *);
69
void switchDetached();
70
void slotInputDeviceChanged(const KoInputDevice & inputDevice);
71
void slotCurrentNodeChanged(KisNodeSP node);
72
void colorSpaceChanged(const KoColorSpace *cs);
76
void updatePaintops();
77
void resourceSelected(KoResource* resource);
78
void slotItemSelected(int index);
79
void slotSaveActivePreset();
80
void slotUpdatePreset();
81
void slotSetupDefaultPreset();
85
KoID defaultPaintop(const KoInputDevice & inputDevice);
86
KisPaintOpPresetSP activePreset(const KoID & paintop, const KoInputDevice & inputDevice);
89
QListWidget* m_cmbPaintops;
90
const KoColorSpace* m_colorspace;
92
KisCanvasResourceProvider *m_resourceProvider;
93
KisPaintOpPresetsChooserPopup* m_presetsChooserPopup;
94
KisPaintOpSettingsWidget* m_optionWidget;
95
KisPaintOpPresetsPopup* m_presetsPopup;
96
QMap<KoID, KisPaintOpSettingsWidget*> m_paintopOptionWidgets;
97
QList<KoID> m_paintops;
98
QList<KoID> m_displayedOps;
99
KisPaintOpPresetSP m_activePreset;
100
KisNodeSP m_previousNode;
101
typedef QHash<KoInputDevice, KoID> InputDevicePaintopMap;
102
InputDevicePaintopMap m_currentID;
104
typedef QHash<QString, KisPaintOpPresetSP> PresetMap;
105
typedef QHash<KoInputDevice, PresetMap > InputDevicePresetsMap;
106
InputDevicePresetsMap m_inputDevicePresets;
111
#endif // KIS_BRUSHENGINE_SELECTOR_H