diff options
Diffstat (limited to 'common/winexe.h')
-rw-r--r-- | common/winexe.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/common/winexe.h b/common/winexe.h index 9aeea379ed..cdbc0f6d13 100644 --- a/common/winexe.h +++ b/common/winexe.h @@ -28,6 +28,8 @@ namespace Common { +class SeekableReadStream; + /** The default Windows resources. */ enum WinResourceType { kWinCursor = 0x01, @@ -90,6 +92,44 @@ struct WinResourceID_EqualTo { bool operator()(const WinResourceID &id1, const WinResourceID &id2) const { return id1 == id2; } }; +/** + * A class able to load resources from a Windows Executable, such + * as cursors, bitmaps, and sounds. + */ +class WinResources { +public: + virtual ~WinResources() {}; + + /** Clear all information. */ + virtual void clear() = 0; + + /** Load from an EXE file. */ + virtual bool loadFromEXE(const String &fileName); + + /** Load from a Windows compressed EXE file. */ + virtual bool loadFromCompressedEXE(const String &fileName); + + /** Load from a stream. */ + virtual bool loadFromEXE(SeekableReadStream *stream) = 0; + + /** Return a list of IDs for a given type. */ + virtual const Array<WinResourceID> getIDList(const WinResourceID &type) const = 0; + + /** Return a list of languages for a given type and ID. */ + virtual const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &id) const { + Array<WinResourceID> array; + return array; + } + + /** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */ + virtual SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id) = 0; + + /** Return a stream to the specified resource (or 0 if non-existent). */ + virtual SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id, const WinResourceID &lang) { + return getResource(type, id); + } +}; + } // End of namespace Common #endif |