chalk

kis_palette_widget.h
1/*
2 * Copyright (c) 2005 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
19#ifndef __KIS_PALETTE_WIDGET_H__
20#define __KIS_PALETTE_WIDGET_H__
21
22#include <tqdict.h>
23#include "kis_palette_view.h"
24
25class TQComboBox;
26class TQLineEdit;
27class TDEListBox;
28class KisPalette;
29class KisResource;
30class KisColor;
31
39class KisPaletteWidget : public TQWidget
40{
41 TQ_OBJECT
42
43public:
44 KisPaletteWidget( TQWidget *parent, int minWidth=210, int cols = 16);
45 virtual ~KisPaletteWidget();
46
47 TQString palette() const;
48 KisPaletteEntry currentEntry() const { return m_view->currentEntry(); }
49
50public slots:
51 void setPalette(const TQString &paletteName);
52
53signals:
54 void colorSelected(const KisColor &);
55 void colorSelected(const TQColor&);
56 void colorDoubleClicked( const KisColor &, const TQString &);
57
58protected slots:
59 void slotSetPalette( const TQString &_paletteName );
60
61public slots:
62 // Called by the resource server whenever a palette is loaded.
63 void slotAddPalette(KisResource * palette);
64
65protected:
66 void readNamedColor( void );
67
68protected:
69 KisPaletteView* m_view;
70 TQDict<KisPalette> m_namedPaletteMap;
71 KisPalette * m_currentPalette;
72 TQComboBox *combo;
73 TQScrollView *sv;
74 int mMinWidth;
75 int mCols;
76 bool init;
77};
78
79#endif
80
A KisColor describes a color in a certain colorspace.
Definition kis_color.h:33
A scrolling view that lists a single KisPalette.
KisPaletteEntry currentEntry() const
Might return the default constructed entry...
A color palette in table form.
Open Gimp, Photoshop or RIFF palette files.
Definition kis_palette.h:50
The KisResource class provides a representation of Chalk image resources.