ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

winexe_ne.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef COMMON_WINEXE_NE_H
00024 #define COMMON_WINEXE_NE_H
00025 
00026 #include "common/list.h"
00027 #include "common/str.h"
00028 #include "common/winexe.h"
00029 
00030 namespace Common {
00031 
00032 template<class T> class Array;
00033 class SeekableReadStream;
00034 
00036 enum NEResourceType {
00037     kNECursor       = 0x01,
00038     kNEBitmap       = 0x02,
00039     kNEIcon         = 0x03,
00040     kNEMenu         = 0x04,
00041     kNEDialog       = 0x05,
00042     kNEString       = 0x06,
00043     kNEFontDir      = 0x07,
00044     kNEFont         = 0x08,
00045     kNEAccelerator  = 0x09,
00046     kNERCData       = 0x0A,
00047     kNEMessageTable = 0x0B,
00048     kNEGroupCursor  = 0x0C,
00049     kNEGroupIcon    = 0x0E,
00050     kNEVersion      = 0x10,
00051     kNEDlgInclude   = 0x11,
00052     kNEPlugPlay     = 0x13,
00053     kNEVXD          = 0x14,
00054     kNEAniCursor    = 0x15,
00055     kNEAniIcon      = 0x16,
00056     kNEHTML         = 0x17,
00057     kNEManifest     = 0x18
00058 };
00059 
00066 class NEResources {
00067 public:
00068     NEResources();
00069     ~NEResources();
00070 
00072     void clear();
00073 
00075     bool loadFromEXE(const String &fileName);
00076 
00078     bool loadFromCompressedEXE(const String &fileName);
00079 
00081     bool loadFromEXE(SeekableReadStream *stream);
00082 
00084     const Array<WinResourceID> getIDList(const WinResourceID &type) const;
00085 
00087     SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id);
00088 
00089 private:
00091     struct Resource {
00092         WinResourceID id;
00093 
00094         WinResourceID type; 
00095 
00096         uint32 offset; 
00097         uint32 size;   
00098 
00099         uint16 flags;
00100         uint16 handle;
00101         uint16 usage;
00102     };
00103 
00104     SeekableReadStream *_exe;        
00105 
00107     List<Resource> _resources;
00108 
00110     uint32 getResourceTableOffset();
00112     bool readResourceTable(uint32 offset);
00113 
00115     const Resource *findResource(const WinResourceID &type, const WinResourceID &id) const;
00116 
00118     static String getResourceString(SeekableReadStream &exe, uint32 offset);
00119 };
00120 
00121 } // End of namespace Common
00122 
00123 #endif


Generated on Sat Feb 23 2019 05:01:21 for ResidualVM by doxygen 1.7.1
curved edge   curved edge