ScummVM API documentation
icocur.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef IMAGE_ICOCUR_H
23#define IMAGE_ICOCUR_H
24
25#include "common/array.h"
26#include "common/types.h"
27
28namespace Common {
29
30class SeekableReadStream;
31
32} // End of namespace Common
33
34namespace Graphics {
35
36class Cursor;
37struct Surface;
38
39} // End of namespace Graphics
40
41namespace Image {
42
44public:
45 enum Type {
46 kTypeInvalid,
47
48 kTypeICO,
49 kTypeCUR,
50 };
51
52 struct Item {
53 struct IconData {
54 uint16 numPlanes;
55 uint16 bitsPerPixel;
56 };
57
58 struct CursorData {
59 uint16 hotspotX;
60 uint16 hotspotY;
61 };
62
63 union DataUnion {
64 IconData ico;
65 CursorData cur;
66 };
67
68 uint16 width;
69 uint16 height;
70 uint8 numColors; // May be 0
71 DataUnion data;
72 uint32 dataSize;
73 uint32 dataOffset;
74 };
75
78
79 bool open(Common::SeekableReadStream &stream, DisposeAfterUse::Flag = DisposeAfterUse::NO);
80 void close();
81
82 Type getType() const;
83 uint numItems() const;
84 const Item &getItem(uint itemIndex) const;
85
92 Graphics::Cursor *loadItemAsCursor(uint itemIndex) const;
93
94private:
95 bool load();
96
97 Type _type;
99
101 DisposeAfterUse::Flag _disposeAfterUse;
102};
103
104} // End of namespace Image
105
106#endif
Definition: stream.h:745
Definition: cursor.h:42
Definition: icocur.h:43
Graphics::Cursor * loadItemAsCursor(uint itemIndex) const
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: atari-cursor.h:35
Definition: icocur.h:52