~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to krita/ui/kis_brushengine_selector.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (c) 2010 Boudewijn Rempt <boud@valdyas.org>
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
#ifndef KIS_BRUSHENGINE_SELECTOR_H
 
19
#define KIS_BRUSHENGINE_SELECTOR_H
 
20
 
 
21
#include <QMap>
 
22
#include <QList>
 
23
#include <QHash>
 
24
#include <QWidget>
 
25
 
 
26
#include <kpagedialog.h>
 
27
 
 
28
#include <KoID.h>
 
29
#include <KoInputDevice.h>
 
30
 
 
31
#include <kis_types.h>
 
32
#include <kis_paintop_settings.h>
 
33
 
 
34
class QListWidget;
 
35
class KoColorSpace;
 
36
class KisCanvasResourceProvider;
 
37
class KisPaintOpSettingsWidget;
 
38
class KisPaintOpPresetsChooserPopup;
 
39
class KisView2;
 
40
class KisPaintOpPresetsPopup;
 
41
class KoResource;
 
42
 
 
43
class KisBrushEngineSelector : public QWidget
 
44
{
 
45
 
 
46
    Q_OBJECT
 
47
    Q_DISABLE_COPY(KisBrushEngineSelector)
 
48
 
 
49
public:
 
50
 
 
51
    explicit KisBrushEngineSelector(KisView2 * view, QWidget *parent = 0);
 
52
    ~KisBrushEngineSelector();
 
53
 
 
54
    KisPaintOpPresetSP paintOpPresetSP(KoID * = 0);
 
55
    const KoID & currentPaintop();
 
56
    void setCurrentPaintop(const KoID & paintop);
 
57
    QPixmap paintopPixmap(const KoID & paintop);
 
58
 
 
59
signals:
 
60
 
 
61
    void signalPaintopChanged(KisPaintOpPresetSP paintop);
 
62
 
 
63
protected:
 
64
 
 
65
    void contextMenuEvent(QContextMenuEvent *);
 
66
 
 
67
public slots:
 
68
 
 
69
    void switchDetached();
 
70
    void slotInputDeviceChanged(const KoInputDevice & inputDevice);
 
71
    void slotCurrentNodeChanged(KisNodeSP node);
 
72
    void colorSpaceChanged(const KoColorSpace *cs);
 
73
 
 
74
private slots:
 
75
 
 
76
    void updatePaintops();
 
77
    void resourceSelected(KoResource* resource);
 
78
    void slotItemSelected(int index);
 
79
    void slotSaveActivePreset();
 
80
    void slotUpdatePreset();
 
81
    void slotSetupDefaultPreset();
 
82
 
 
83
private:
 
84
 
 
85
    KoID defaultPaintop(const KoInputDevice & inputDevice);
 
86
    KisPaintOpPresetSP activePreset(const KoID & paintop, const KoInputDevice & inputDevice);
 
87
 
 
88
 
 
89
    QListWidget* m_cmbPaintops;
 
90
    const KoColorSpace* m_colorspace;
 
91
    KisView2* m_view;
 
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;
 
103
 
 
104
    typedef QHash<QString, KisPaintOpPresetSP> PresetMap;
 
105
    typedef QHash<KoInputDevice, PresetMap > InputDevicePresetsMap;
 
106
    InputDevicePresetsMap m_inputDevicePresets;
 
107
 
 
108
    bool m_detached;
 
109
};
 
110
 
 
111
#endif // KIS_BRUSHENGINE_SELECTOR_H