chalk

kis_paintop_box.h
1/*
2 * kis_paintop_box.h - part of KImageShop/Krayon/Chalk
3 *
4 * Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef KIS_PAINTOP_BOX_H_
22#define KIS_PAINTOP_BOX_H_
23
24#include <map>
25
26#include <tqwidget.h>
27#include <tqcombobox.h>
28#include <tqvaluelist.h>
29
30#include "kis_input_device.h"
31
32class TQString;
33
34class KWidgetAction;
35class KisView;
37class KisID;
38class KisColorSpace;
39
50class KisPaintopBox : public TQWidget {
51
52 TQ_OBJECT
53
54
55 typedef TQWidget super;
56
57public:
58 KisPaintopBox (KisView * view, TQWidget * parent, const char * name = 0);
59
61
62
63signals:
64
65 void selected(const KisID & id, const KisPaintOpSettings *settings);
66
67private slots:
68
69 void addItem(const KisID & paintop, const TQString & category = "");
70
71private slots:
72
73 void slotItemSelected(int index);
74 void colorSpaceChanged(KisColorSpace *cs);
75 void slotInputDeviceChanged(const KisInputDevice & inputDevice);
76
77private:
78 TQPixmap paintopPixmap(const KisID & paintop);
79 void updateOptionWidget();
80 const KisID & currentPaintop();
81 void setCurrentPaintop(const KisID & paintop);
82 KisID defaultPaintop(const KisInputDevice& inputDevice);
83 const KisPaintOpSettings *paintopSettings(const KisID & paintop, const KisInputDevice & inputDevice);
84
85private:
86 KisCanvasController *m_canvasController;
87 TQComboBox * m_cmbPaintops;
88 TQHBoxLayout * m_layout;
89 TQWidget * m_optionWidget;
90
91 TQValueList<KisID> * m_paintops;
92 TQValueList<KisID> * m_displayedOps;
93
94 typedef std::map<KisInputDevice, KisID> InputDevicePaintopMap;
95 InputDevicePaintopMap m_currentID;
96
97 typedef std::map<KisInputDevice, TQValueVector<KisPaintOpSettings *> > InputDevicePaintopSettingsMap;
98 InputDevicePaintopSettingsMap m_inputDevicePaintopSettings;
99};
100
101
102
103#endif //KIS_PAINTOP_BOX_H_
104
Interface for classes that implement a canvas; i.e., a widget where KisImages are painted onto.
A colorspace is the definition of a certain color model in Chalk.
Chalk has a large number of extensible resources.
Definition kis_id.h:57
This widget presents all paintops that a user can paint with.