Changeset View
Changeset View
Standalone View
Standalone View
libs/pigment/resources/KoColorSet_p.h
Context not available. | |||||
21 | quint16 colorcount; | 21 | quint16 colorcount; | ||
---|---|---|---|---|---|
22 | }; | 22 | }; | ||
23 | 23 | | |||
24 | // groups[0] is always the global group | ||||
24 | class KoColorSet::Private | 25 | class KoColorSet::Private | ||
25 | { | 26 | { | ||
26 | private: | 27 | private: | ||
Context not available. | |||||
31 | 32 | | |||
32 | public: | 33 | public: | ||
33 | KisSwatchGroup &global() { | 34 | KisSwatchGroup &global() { | ||
34 | Q_ASSERT(groups.contains(GLOBAL_GROUP_NAME)); | 35 | assert(groups.size() && groups.front().name() == GLOBAL_GROUP_NAME); | ||
35 | return groups[GLOBAL_GROUP_NAME]; | 36 | return groups.front(); | ||
36 | } | 37 | } | ||
38 | | ||||
37 | public: | 39 | public: | ||
38 | bool init(); | 40 | bool init(); | ||
39 | 41 | | |||
Context not available. | |||||
55 | KoColorSet::PaletteType paletteType; | 57 | KoColorSet::PaletteType paletteType; | ||
56 | QByteArray data; | 58 | QByteArray data; | ||
57 | QString comment; | 59 | QString comment; | ||
58 | QStringList groupNames; //names of the groups, this is used to determine the order they are in. | 60 | QList<KisSwatchGroup> groups; | ||
59 | QHash<QString, KisSwatchGroup> groups; //grouped colors. | | |||
60 | bool isGlobal; | 61 | bool isGlobal; | ||
61 | bool isEditable; | 62 | bool isEditable; | ||
62 | 63 | | |||
63 | private: | 64 | private: | ||
64 | KoColorSet::PaletteType detectFormat(const QString &fileName, const QByteArray &ba); | 65 | quint16 readShort(QIODevice *io); | ||
66 | KoColorSet::PaletteType detectFormat(const QString &fileName, | ||||
67 | const QByteArray &ba); | ||||
65 | void scribusParseColor(KoColorSet *set, QXmlStreamReader *xml); | 68 | void scribusParseColor(KoColorSet *set, QXmlStreamReader *xml); | ||
66 | bool loadScribusXmlPalette(KoColorSet *set, QXmlStreamReader *xml); | 69 | bool loadScribusXmlPalette(KoColorSet *set, QXmlStreamReader *xml); | ||
67 | quint16 readShort(QIODevice *io); | 70 | void saveKplGroup(QDomDocument &doc, | ||
68 | 71 | QDomElement &groupEle, | |||
69 | void saveKplGroup(QDomDocument &doc, QDomElement &groupEle, | 72 | const KisSwatchGroup *group, | ||
70 | const KisSwatchGroup *group, QSet<const KoColorSpace *> &colorSetSet) const; | 73 | QSet<const KoColorSpace *> &colorSetSet) const; | ||
71 | void loadKplGroup(const QDomDocument &doc, const QDomElement &parentElement, KisSwatchGroup *group); | 74 | void loadKplGroup(const QDomDocument &doc, | ||
75 | const QDomElement &parentElement, KisSwatchGroup *group); | ||||
72 | }; | 76 | }; | ||
73 | 77 | | |||
74 | #endif // KOCOLORSET_P_H | 78 | #endif // KOCOLORSET_P_H | ||
Context not available. |