Changeset View
Changeset View
Standalone View
Standalone View
libs/pigment/resources/KoColorSet_p.h
- This file was added.
1 | #ifndef KOCOLORSET_P_H | ||||
---|---|---|---|---|---|
2 | #define KOCOLORSET_P_H | ||||
3 | | ||||
4 | #include <QHash> | ||||
5 | #include <QXmlStreamReader> | ||||
6 | #include <QDomElement> | ||||
7 | #include <QPointer> | ||||
8 | | ||||
9 | #include <KisSwatch.h> | ||||
10 | #include <KisSwatchGroup.h> | ||||
11 | | ||||
12 | #include "KoColorSet.h" | ||||
13 | | ||||
14 | struct RiffHeader { | ||||
15 | quint32 riff; | ||||
16 | quint32 size; | ||||
17 | quint32 signature; | ||||
18 | quint32 data; | ||||
19 | quint32 datasize; | ||||
20 | quint16 version; | ||||
21 | quint16 colorcount; | ||||
22 | }; | ||||
23 | | ||||
24 | class KoColorSet::Private | ||||
25 | { | ||||
26 | private: | ||||
27 | typedef KisSwatchGroup::SwatchInfo SwatchInfoType; | ||||
28 | | ||||
29 | public: | ||||
30 | Private(KoColorSet *a_colorSet); | ||||
31 | | ||||
32 | public: | ||||
33 | KisSwatchGroup &global() { | ||||
34 | Q_ASSERT(groups.contains(GLOBAL_GROUP_NAME)); | ||||
35 | return groups[GLOBAL_GROUP_NAME]; | ||||
36 | } | ||||
37 | public: | ||||
38 | bool init(); | ||||
39 | | ||||
40 | bool saveGpl(QIODevice *dev) const; | ||||
41 | bool loadGpl(); | ||||
42 | | ||||
43 | bool loadAct(); | ||||
44 | bool loadRiff(); | ||||
45 | bool loadPsp(); | ||||
46 | bool loadAco(); | ||||
47 | bool loadXml(); | ||||
48 | bool loadSbz(); | ||||
49 | | ||||
50 | bool saveKpl(QIODevice *dev) const; | ||||
51 | bool loadKpl(); | ||||
52 | | ||||
53 | public: | ||||
54 | KoColorSet *colorSet; | ||||
55 | KoColorSet::PaletteType paletteType; | ||||
56 | QByteArray data; | ||||
57 | QString comment; | ||||
58 | QStringList groupNames; //names of the groups, this is used to determine the order they are in. | ||||
59 | QHash<QString, KisSwatchGroup> groups; //grouped colors. | ||||
60 | bool isGlobal; | ||||
61 | bool isEditable; | ||||
62 | | ||||
63 | private: | ||||
64 | KoColorSet::PaletteType detectFormat(const QString &fileName, const QByteArray &ba); | ||||
65 | void scribusParseColor(KoColorSet *set, QXmlStreamReader *xml); | ||||
66 | bool loadScribusXmlPalette(KoColorSet *set, QXmlStreamReader *xml); | ||||
67 | quint16 readShort(QIODevice *io); | ||||
68 | | ||||
69 | void saveKplGroup(QDomDocument &doc, QDomElement &groupEle, | ||||
70 | const KisSwatchGroup *group, QSet<const KoColorSpace *> &colorSetSet) const; | ||||
71 | void loadKplGroup(const QDomDocument &doc, const QDomElement &parentElement, KisSwatchGroup *group); | ||||
72 | }; | ||||
73 | | ||||
74 | #endif // KOCOLORSET_P_H |