summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/icns/qicnshandler_p.h
diff options
context:
space:
mode:
authorAlex <prevedtest@gmail.com>2014-01-15 19:36:44 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-26 09:18:49 +0100
commitd47d38d7d718673e2c3673bb13fa158446ae8fba (patch)
treedb3666b86d6f4bfd92b567f405889957f1456aff /src/plugins/imageformats/icns/qicnshandler_p.h
parent10f883c2dc8264cec87e0e07a0968142216740be (diff)
Add support for reading icon variants in ICNS plugin
Change-Id: I68395ac4e9604d852405643710aa79585974b3e3 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/imageformats/icns/qicnshandler_p.h')
-rw-r--r--src/plugins/imageformats/icns/qicnshandler_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/imageformats/icns/qicnshandler_p.h b/src/plugins/imageformats/icns/qicnshandler_p.h
index 12c165b..747cb3e 100644
--- a/src/plugins/imageformats/icns/qicnshandler_p.h
+++ b/src/plugins/imageformats/icns/qicnshandler_p.h
@@ -60,6 +60,11 @@ struct ICNSBlockHeader
TypeIcnv = MAKEOSTYPE('i', 'c', 'n', 'V'), // Icon Composer version
// Legacy:
TypeClut = MAKEOSTYPE('c', 'l', 'u', 't'), // Color look-up table (pre-OS X resources)
+ TypeTile = MAKEOSTYPE('t', 'i', 'l', 'e'), // Container (icon variants)
+ TypeOver = MAKEOSTYPE('o', 'v', 'e', 'r'), // Container (icon variants)
+ TypeOpen = MAKEOSTYPE('o', 'p', 'e', 'n'), // Container (icon variants)
+ TypeDrop = MAKEOSTYPE('d', 'r', 'o', 'p'), // Container (icon variants)
+ TypeOdrp = MAKEOSTYPE('o', 'd', 'r', 'p'), // Container (icon variants)
};
quint32 ostype;
@@ -102,6 +107,7 @@ struct ICNSEntry
};
quint32 ostype; // Real OSType
+ quint32 variant; // Virtual OSType: a parent container, zero if parent is icns root
Group group; // ASCII character number
quint32 width; // For uncompressed icons only, zero for compressed ones for now
quint32 height; // For uncompressed icons only, zero for compressed ones fow now
@@ -112,7 +118,7 @@ struct ICNSEntry
qint64 dataOffset; // Offset from the initial position of the file/device
ICNSEntry() :
- ostype(0), group(GroupUnknown), width(0), height(0), depth(DepthUnknown),
+ ostype(0), variant(0), group(GroupUnknown), width(0), height(0), depth(DepthUnknown),
flags(Unknown), dataFormat(FormatUnknown), dataLength(0), dataOffset(0)
{
}
@@ -142,7 +148,7 @@ public:
private:
bool ensureScanned() const;
bool scanDevice();
- bool addEntry(const ICNSBlockHeader &header, qint64 imgDataOffset);
+ bool addEntry(const ICNSBlockHeader &header, qint64 imgDataOffset, quint32 variant = 0);
const ICNSEntry &getIconMask(const ICNSEntry &icon) const;
private: