[Scummvm-cvs-logs] SF.net SVN: scummvm: [27956] scummex/branches/gsoc2007-gameresbrowser

zbychs at users.sourceforge.net zbychs at users.sourceforge.net
Sun Jul 8 05:08:30 CEST 2007


Revision: 27956
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27956&view=rev
Author:   zbychs
Date:     2007-07-07 20:08:29 -0700 (Sat, 07 Jul 2007)

Log Message:
-----------
Added initial support for Scumm data files - not useable yet.
Additional work on presenters.

Modified Paths:
--------------
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/FileTypeRecognizer.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt
    scummex/branches/gsoc2007-gameresbrowser/src/core/common/simplefile.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ftregistry.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform
    scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/VirtualNode.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/ftregistry.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/samples/pinslot_plugins.cpp
    scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj
    scummex/branches/gsoc2007-gameresbrowser/vc8/core/core.vcproj
    scummex/branches/gsoc2007-gameresbrowser/vc8/mkdot.bat
    scummex/branches/gsoc2007-gameresbrowser/vc8/plugins/plugins.vcproj
    scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout

Added Paths:
-----------
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/FileType.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/PanelProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/BlockyBlockPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/BlockyBlockPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummRecognizer.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummRecognizer.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/scummutil.h
    scummex/branches/gsoc2007-gameresbrowser/wxdev/TextPresenterDlg.cpp
    scummex/branches/gsoc2007-gameresbrowser/wxdev/TextPresenterDlg.h
    scummex/branches/gsoc2007-gameresbrowser/wxdev/TextPresenterDlg.wxform

Removed Paths:
-------------
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.h

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -9,15 +9,31 @@
 
 namespace Browser {
 
+namespace CoreFileTypes {
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // FileTypes
 
-SAFE_STATIC(binaryFileType, BGUID, (wxT("CoreFileTypes"), wxT("Binary File"), 1) )
+SAFE_STATIC(binaryFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Binary File"), 1) )
 
-SAFE_STATIC(bmpFileType, BGUID, (wxT("CoreFileTypes"), wxT("Windows Bitmap File (BMP)"), 1) )
+SAFE_STATIC(bmpFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Windows Bitmap File (BMP)"), 1) )
 
+SAFE_STATIC(textFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Text File"), 1) )
+
+SAFE_STATIC(rootDirectoryFileType, RecognizedFileType,
+			(PERFECT_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Root Directory"), 1)) )
+
+SAFE_STATIC(diskDirectoryFileType, RecognizedFileType,
+			(PERFECT_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Disk Directory"), 1)) )
+
+//CAUTION: NO_MATCH here - so that Disk File is not considered a valid file type (it's only for informational/debug purposes)
+SAFE_STATIC(diskFileFileType, RecognizedFileType,
+			(NO_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Disk File"), 1)) )
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+} // namespace CoreFileTypes
+
 } // namespace Browser

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -5,22 +5,36 @@
 #define _CORE_FILE_TYPES_H_
 
 #include "guid.h"
+#include "FileType.h"
 
 #include "safe_static.h"
 
 namespace Browser {
 
+namespace CoreFileTypes {
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // FileTypes
 
-SAFE_STATIC_DECL(binaryFileType, BGUID)
+SAFE_STATIC_DECL(binaryFileTypeGUID, BGUID)
 
-SAFE_STATIC_DECL(bmpFileType, BGUID)
+SAFE_STATIC_DECL(bmpFileTypeGUID, BGUID)
 
+SAFE_STATIC_DECL(textFileTypeGUID, BGUID)
+
+SAFE_STATIC_DECL(rootDirectoryFileType, RecognizedFileType)
+
+SAFE_STATIC_DECL(diskDirectoryFileType, RecognizedFileType)
+
+//CAUTION: NO_MATCH here - so that Disk File is not considered a valid file type (it's only for informational/debug purposes)
+SAFE_STATIC_DECL(diskFileFileType, RecognizedFileType)
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+} // namespace CoreFileTypes
+
 } // namespace Browser
 
 #endif // _CORE_FILE_TYPES_H_

Copied: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.cpp (from rev 27944, scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,164 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreInterfaces.cpp
+
+#include "core_stdafx.h"
+
+#include "CoreInterfaces.h"
+#include "CoreFileTypes.h"
+#include "common/simplefile.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Concrete implementations of the interfaces
+
+IDirectoryImpl::IDirectoryImpl(IDirectory* parentDir, coreString name,
+			   bool ownInterfaces)
+	: _parentDir(parentDir), _name(name), _ifiles(), _isubdirs(),
+		_ownInterfaces(ownInterfaces), _fileType(RecognizedFileType::NotRecognized()) {}
+
+IDirectoryImpl::IDirectoryImpl(IDirectory* parentDir, coreString name,
+			   const ifile_list& ifiles, const idir_list& isubdirs,
+			   bool ownInterfaces)
+	: _parentDir(parentDir), _name(name), _ifiles(ifiles), _isubdirs(isubdirs),
+		_ownInterfaces(ownInterfaces), _fileType(RecognizedFileType::NotRecognized()) {}
+
+IDirectoryImpl::~IDirectoryImpl() {
+	if (!_ownInterfaces)
+		return;
+
+	std::list<IFile*>::const_iterator i;
+	for (i = _ifiles.begin(); i != _ifiles.end(); ++i) {
+		delete *i;
+	}
+
+	std::list<IDirectory*>::const_iterator j;
+	for (j = _isubdirs.begin(); j != _isubdirs.end(); ++j) {
+		delete *j;
+	}
+}
+
+const coreString& IDirectoryImpl::getName() {
+	return _name;
+}
+
+IDirectory* IDirectoryImpl::getParentDirectory() {
+	return _parentDir;
+}
+
+const RecognizedFileType& IDirectoryImpl::getDirectoryFileType() {
+	return _fileType;
+}
+
+void IDirectoryImpl::setDirectoryFileType(const RecognizedFileType& fileType) {
+	_fileType = fileType;
+}
+
+const ifile_list& IDirectoryImpl::getFiles() {
+	//infoout << wxT("IDirectoryImpl::getFiles()") << std::endl;
+	return _ifiles;
+}
+
+const idir_list& IDirectoryImpl::getSubDirs() {
+	//infoout << wxT("IDirectoryImpl::getSubDirs()") << std::endl;
+	return _isubdirs;
+}
+
+void IDirectoryImpl::addFile(IFile* ifile) {
+	_ifiles.push_back(ifile);
+}
+
+void IDirectoryImpl::addSubDir(IDirectory* idir) {
+	_isubdirs.push_back(idir);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+IStreamImpl::IStreamImpl(Common::SeekableReadStream* stream, bool ownStream /*= false*/)
+	: _stream(stream), _ownStream(ownStream) {}
+
+Common::SeekableReadStream* IStreamImpl::getStream() {
+	return _stream;
+}
+
+IStreamImpl::~IStreamImpl() {
+	if (_ownStream)
+		delete _stream;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+IFileImplBase::IFileImplBase(IDirectory* parentDir, coreString name)
+	: _parentDir(parentDir), _name(name),
+		_fileType(RecognizedFileType::NotRecognized()) {}
+
+const coreString& IFileImplBase::getName() {
+	return _name;
+}
+
+const RecognizedFileType& IFileImplBase::getFileType() {
+	return _fileType;
+}
+
+void IFileImplBase::setFileType(const RecognizedFileType& fileType) {
+	_fileType = fileType;
+}
+
+IDirectory* IFileImplBase::getParentDirectory() {
+	return _parentDir;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+IStreamFileImpl::IStreamFileImpl(IDirectory* parentDir, coreString name, Common::SeekableReadStream* stream, bool ownStream /*= false*/)
+	: IFileImplBase(parentDir, name), _streamImpl(stream, ownStream) {}
+
+Common::SeekableReadStream* IStreamFileImpl::getStream() {
+	return _streamImpl.getStream();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+IDiskFileImpl::IDiskFileImpl(IDirectory* parentDir, coreString name, coreString fullpath)
+	: IFileImplBase(parentDir, name), _fullpath(fullpath), _stream(NULL) {
+		_fileType = CoreFileTypes::diskFileFileType();
+	}
+
+IDiskFileImpl::~IDiskFileImpl() {
+	diet();
+}
+
+void IDiskFileImpl::diet() {
+	if (_stream)
+		delete _stream;
+	_stream = NULL;
+}
+
+Common::SeekableReadStream* IDiskFileImpl::getStream() {
+	if (!_stream) {
+		Common::SimpleFile* file = new Common::SimpleFile();
+		bool res = file->open(_fullpath);
+		if (!res) {
+			errout << wxT("ERROR: IDiskFileImpl::getStream(): could not open file") << std::endl;
+			delete file;
+			return NULL;
+		}
+		_stream = file;
+	}
+
+	return _stream;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h (from rev 27944, scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,235 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreInterfaces.h
+
+#ifndef _CORE_INTERFACES_H_
+#define _CORE_INTERFACES_H_
+
+#include "core_stdafx.h"
+
+#include "pinslot.h"
+#include "FileType.h"
+
+#include <list>
+#include "common/stream.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Interfaces
+
+template<typename T>
+class IProvider : public IInterface {
+public:
+	ASSIGN_GUID_VERBOSE( toString(typeid(IProvider<T>).name()), wxT("CoreInterfaces"), 1);
+	virtual T* getData() = 0;
+	virtual void release() {
+		delete this;
+	}
+};
+
+template<typename T>
+class IProviderImpl : public IProvider<T> {
+	bool _ownData;
+	T* _data;
+public:
+	IProviderImpl(T* data, bool ownData = false)
+		: _data(data), _ownData(ownData) {}
+	virtual ~IProviderImpl() {
+		if (_ownData && _data)
+			delete _data;
+	}
+	virtual T* getData() {
+		return _data;
+	}
+	virtual void setData(T* data) {
+		_data = data;
+	}
+	virtual void release() {
+		delete this;
+	}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class IStream : public IInterface {
+public:
+	GUID_FOR(IStream, wxT("CoreInterfaces"), 1);
+	virtual Common::SeekableReadStream* getStream() = 0;
+};
+
+class IDirectory;
+
+class IFile : public IStream {
+public:
+	GUID_FOR(IFile, wxT("CoreInterfaces"), 1);
+	virtual const coreString& getName() = 0;
+
+	//can be not set (returns a file type that is !isOk())
+	virtual const RecognizedFileType& getFileType() = 0;
+	virtual void setFileType(const RecognizedFileType& fileType) = 0;
+
+	//can return NULL
+	virtual IDirectory* getParentDirectory() = 0;
+};
+
+//TODO: IDirectory should support get/release semantics for IFiles
+//      It would enable disk files once opened, to be closed, memory
+//      once allocated, to be freed when not used anymore.
+//      Do it via dynamic dummy Slots?
+class IDirectory : public IInterface {
+public:
+	GUID_FOR(IDirectory, wxT("CoreInterfaces"), 1);
+	virtual const coreString& getName() = 0;
+	virtual const std::list<IFile*>& getFiles() = 0;
+	virtual const std::list<IDirectory*>& getSubDirs() = 0;
+
+	//can be not set (returns a file type that is !isOk())
+	//it is a helper for recognizing files based on the type of the container
+	//they are in (i.e. file with magic BM can be a BMP, but if it is in an XXX
+	//container, then we know it's something else).
+	virtual const RecognizedFileType& getDirectoryFileType() = 0;
+
+	//can return NULL
+	virtual IDirectory* getParentDirectory() = 0;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+typedef std::list<IFile*> ifile_list;
+typedef std::list<IDirectory*> idir_list;
+
+class IDirectoryImpl : public IDirectory {
+
+protected:
+	coreString _name;
+	RecognizedFileType _fileType;
+	IDirectory* _parentDir;
+
+	bool _ownInterfaces;
+	ifile_list _ifiles;
+	idir_list _isubdirs;
+
+public:
+	//inherit guid - it's a concrete implementation of an abstract interface
+	IDirectoryImpl(IDirectory* parentDir, coreString name,
+		bool ownInterfaces);
+	IDirectoryImpl(IDirectory* parentDir, coreString name,
+		const ifile_list& ifiles, const idir_list& isubdirs,
+		bool ownInterfaces);
+	virtual ~IDirectoryImpl();
+
+	virtual const coreString& getName();
+
+	virtual const RecognizedFileType& getDirectoryFileType();
+	virtual void setDirectoryFileType(const RecognizedFileType& fileType); //not in IDirectory interface
+
+	//can return NULL
+	virtual IDirectory* getParentDirectory();
+
+	void addFile(IFile* ifile);
+	void addSubDir(IDirectory* idir);
+
+	virtual const ifile_list& getFiles();
+	virtual const idir_list& getSubDirs();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Concrete implementations of the interfaces
+
+class IStreamImpl : public IStream {
+protected:
+	Common::SeekableReadStream* _stream;
+	bool _ownStream;
+public:
+	//inherit guid - it's a concrete implementation of an abstract interface
+	IStreamImpl(Common::SeekableReadStream* stream, bool ownStream = false);
+	virtual Common::SeekableReadStream* getStream();
+	virtual ~IStreamImpl();
+};
+
+// Limitation: can't inherit from IFile and IStreamImpl, cause I'll have to inherit
+// virtually from IStream to IStreamImpl and from IStream to IFile. It can't be done,
+// since virtual inheritance disallows casting from virtual base class (here:
+// IInterface) to a derived class (here: IFile).
+// Instead of multiple inheritance - I use encapsulation: _streamImpl member.
+class IFileImplBase : public IFile {
+protected:
+	coreString _name;
+	RecognizedFileType _fileType;
+	IDirectory* _parentDir;
+public:
+	//inherit guid - it's a concrete implementation of an abstract interface
+	IFileImplBase(IDirectory* parentDir, coreString name);
+	virtual const coreString& getName();
+	virtual Common::SeekableReadStream* getStream() = 0;
+
+	//can be not set (returns a file type that is !isOk())
+	virtual const RecognizedFileType& getFileType();
+	virtual void setFileType(const RecognizedFileType& fileType);
+
+	//can return NULL
+	virtual IDirectory* getParentDirectory();
+};
+
+class IStreamFileImpl : public IFileImplBase {
+protected:
+	IStreamImpl _streamImpl;
+public:
+	//inherit guid - it's a concrete implementation of an abstract interface
+	IStreamFileImpl(IDirectory* parentDir, coreString name, Common::SeekableReadStream* stream, bool ownStream = false);
+	virtual Common::SeekableReadStream* getStream();
+};
+
+class IDiskFileImpl : public IFileImplBase {
+protected:
+	coreString _fullpath;
+	Common::SeekableReadStream* _stream;
+public:
+	//inherit guid - it's a concrete implementation of an abstract interface
+	IDiskFileImpl(IDirectory* parentDir, coreString name, coreString fullpath);
+	virtual ~IDiskFileImpl();
+	virtual Common::SeekableReadStream* getStream();
+
+	//closes the underlying file, getStream() will reopen it if needed
+	virtual void diet();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//to be used by TextPresenter, so it has a title and the text
+class IText : public IInterface {
+public:
+	GUID_FOR(IText, wxT("CoreInterfaces"), 1);
+	virtual const wxString& getTitle() = 0;
+	virtual const wxString& getText() = 0;
+	virtual void release() {
+		delete this;
+	}
+};
+
+class ITextImpl : public IText {
+	wxString _title;
+	wxString _text;
+public:
+	ITextImpl(const wxString& title, const wxString& text)
+		: _title(title), _text(text) {}
+
+	virtual const wxString& getTitle() {
+		return _title;
+	}
+	virtual const wxString& getText() {
+		return _text;
+	}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif // _CORE_INTERFACES_H_

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,81 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// CoreIntf.cpp
-
-#include "core_stdafx.h"
-
-#include "CoreIntf.h"
-#include "common/simplefile.h"
-
-#include <iostream>
-
-#include "debugmem.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// Concrete implementations of the interfaces
-
-IStreamImpl::IStreamImpl(Common::SeekableReadStream* stream, bool ownStream /*= false*/)
-	: _stream(stream), _ownStream(ownStream) {}
-
-Common::SeekableReadStream* IStreamImpl::getStream() {
-	return _stream;
-}
-
-IStreamImpl::~IStreamImpl() {
-	if (_ownStream)
-		delete _stream;
-}
-
-
-IFileImpl::IFileImpl(coreString name, Common::SeekableReadStream* stream, bool ownStream /*= false*/)
-	: _streamImpl(stream, ownStream), _name(name) {}
-
-const coreString& IFileImpl::getName() {
-	return _name;
-}
-
-Common::SeekableReadStream* IFileImpl::getStream() {
-	return _streamImpl.getStream();
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-IDiskFileImpl::IDiskFileImpl(coreString name, coreString fullpath)
-	: _name(name), _fullpath(fullpath), _stream(NULL) {}
-
-IDiskFileImpl::~IDiskFileImpl() {
-	diet();
-}
-
-void IDiskFileImpl::diet() {
-	if (_stream)
-		delete _stream;
-	_stream = NULL;
-}
-
-const coreString& IDiskFileImpl::getName() {
-	return _name;
-}
-
-Common::SeekableReadStream* IDiskFileImpl::getStream() {
-	if (!_stream) {
-		Common::SimpleFile* file = new Common::SimpleFile();
-		bool res = file->open(_fullpath);
-		if (!res) {
-			errout << wxT("ERROR: IDiskFileImpl::getStream(): could not open file") << std::endl;
-			delete file;
-			return NULL;
-		}
-		_stream = file;
-	}
-
-	return _stream;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,94 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// CoreIntf.h
-
-#ifndef _CORE_INTERFACES_H_
-#define _CORE_INTERFACES_H_
-
-#include "core_stdafx.h"
-
-#include "pinslot.h"
-
-#include <list>
-#include "common/stream.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// Interfaces
-
-class IStream : public IInterface {
-public:
-	GUID_FOR(IStream, wxT("CoreInterfaces"), 1);
-	virtual Common::SeekableReadStream* getStream() = 0;
-};
-
-class IFile : public IStream {
-public:
-	GUID_FOR(IFile, wxT("CoreInterfaces"), 1);
-	virtual const coreString& getName() = 0;
-};
-
-//TODO: IDirectory should support get/release semantics for IFiles
-//      It would enable disk files once opened, to be closed, memory
-//      once allocated, to be freed when not used anymore.
-//      Do it via dynamic dummy Slots?
-class IDirectory : public IInterface {
-public:
-	GUID_FOR(IDirectory, wxT("CoreInterfaces"), 1);
-	virtual const coreString& getName() = 0;
-	virtual const std::list<IFile*>& getFiles() = 0;
-	virtual const std::list<IDirectory*>& getSubDirs() = 0;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// Concrete implementations of the interfaces
-
-class IStreamImpl : public IStream {
-protected:
-	Common::SeekableReadStream* _stream;
-	bool _ownStream;
-public:
-	//inherit guid - it's a concrete implementation of an abstract interface
-	IStreamImpl(Common::SeekableReadStream* stream, bool ownStream = false);
-	virtual Common::SeekableReadStream* getStream();
-	virtual ~IStreamImpl();
-};
-
-// Limitation: can't inherit from IFile and IStreamImpl, cause I'll have to inherit
-// virtually from IStream to IStreamImpl and from IStream to IFile. It can't be done,
-// since virtual inheritance disallows casting from virtual base class (here:
-// IInterface) to a derived class (here: IFile).
-// Instead of multiple inheritance - I use encapsulation: _streamImpl member.
-class IFileImpl : public IFile {
-protected:
-	coreString _name;
-	IStreamImpl _streamImpl;
-public:
-	//inherit guid - it's a concrete implementation of an abstract interface
-	IFileImpl(coreString name, Common::SeekableReadStream* stream, bool ownStream = false);
-	virtual const coreString& getName();
-	virtual Common::SeekableReadStream* getStream();
-};
-
-class IDiskFileImpl : public IFile {
-protected:
-	coreString _name;
-	coreString _fullpath;
-	Common::SeekableReadStream* _stream;
-public:
-	//inherit guid - it's a concrete implementation of an abstract interface
-	IDiskFileImpl(coreString name, coreString fullpath);
-	virtual ~IDiskFileImpl();
-	virtual void diet();
-	virtual const coreString& getName();
-	virtual Common::SeekableReadStream* getStream();
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser
-
-#endif // _CORE_INTERFACES_H_

Added: scummex/branches/gsoc2007-gameresbrowser/src/core/FileType.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/FileType.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/FileType.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,84 @@
+/////////////////////////////////////////////////////////////////////////////
+// FileType.h
+
+#ifndef _FILE_TYPE_H_
+#define _FILE_TYPE_H_
+
+#include <list>
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+// When a VirtualFile is to be presented the following happens:
+//   - recognize() is run on all FileTypeRecognizers found
+//      -- we get a list of file type GUID's
+//   - we find all FileTypeParsers for each file type GUID and choose one of them
+
+// How the priorities work:
+//   - FileTypeMatch can be IDEAL, GOOD or POOR, example:
+//     BMP:  BMPFileType - IDEAL,
+//           BinaryFileType - POOR
+//   - ResolvedParsersPriority can be IDEAL, GOOD or POOR, example:
+//     BMPFileType:  BMPParser + BMPInformationParser - IDEAL,
+//                   BinaryParser - POOR
+//
+// PERFECT_MATCH is reserved for an IDEAL_MATCH, that takes the container type into
+// consideration.
+
+enum FileTypeMatch {
+	NO_MATCH = -1,
+	PERFECT_MATCH = 1,
+	IDEAL_MATCH = 2,
+	GOOD_MATCH = 3,
+	POOR_MATCH = 4,
+};
+
+enum ResolvedParsersPriority {
+	NO_PARSERS = -1,
+	//PERFECT_PARSERS = 1, nonsense
+	IDEAL_PARSERS = 2,
+	GOOD_PARSERS = 3,
+	POOR_PARSERS = 4,
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+struct RecognizedFileType {
+	static const RecognizedFileType& NotRecognized();
+
+	FileTypeMatch _match;
+	BGUID _fileTypeGUID;
+	RecognizedFileType(FileTypeMatch match, const BGUID& fileTypeGUID)
+		: _match(match), _fileTypeGUID(fileTypeGUID) {}
+
+	/*RecognizedFileType(const RecognizedFileType& other)
+		: _match(other._match), _fileTypeGUID(other._fileTypeGUID) {}
+	RecognizedFileType& operator=(const RecognizedFileType& other) {
+		_match = other._match; _fileTypeGUID = other._fileTypeGUID;
+	}*/
+
+	bool isOk() const {
+		return _match != NO_MATCH;
+	}
+
+	const BGUID& getFileTypeGUID() const {
+		return _fileTypeGUID;
+	}
+
+	bool operator<(const RecognizedFileType& other) const {
+		return this->_match < other._match;
+	}
+};
+
+typedef std::list<RecognizedFileType> RecognizedFileTypes;
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif // _FILE_TYPE_H_


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/core/FileType.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/FileTypeRecognizer.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/FileTypeRecognizer.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/FileTypeRecognizer.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -6,7 +6,8 @@
 
 #include "pinslot.h"
 
-#include "CoreIntf.h"
+#include "FileType.h"
+#include "CoreInterfaces.h"
 #include "CoreFileTypes.h"
 
 #include <list>
@@ -29,49 +30,9 @@
 //     BMPFileType:  BMPParser + BMPInformationParser - IDEAL,
 //                   BinaryParser - POOR
 
-enum FileTypeMatch {
-	NO_MATCH = -1,
-	IDEAL_MATCH = 1,
-	GOOD_MATCH = 2,
-	POOR_MATCH = 3,
-};
-
-enum ResolvedParsersPriority {
-	NO_PARSERS = -1,
-	IDEAL_PARSERS = 1,
-	GOOD_PARSERS = 2,
-	POOR_PARSERS = 3,
-};
-
-
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-struct RecognizedFileType {
-	static const RecognizedFileType& NotRecognized();
-
-	FileTypeMatch _match;
-	BGUID _fileTypeGUID;
-	RecognizedFileType(FileTypeMatch match, const BGUID& fileTypeGUID)
-		: _match(match), _fileTypeGUID(fileTypeGUID) {}
-
-	/*RecognizedFileType(const RecognizedFileType& other)
-		: _match(other._match), _fileTypeGUID(other._fileTypeGUID) {}
-	RecognizedFileType& operator=(const RecognizedFileType& other) {
-		_match = other._match; _fileTypeGUID = other._fileTypeGUID;
-	}*/
-
-	bool isOk() {
-		return _match != NO_MATCH;
-	}
-	bool operator<(const RecognizedFileType& other) const {
-		return this->_match < other._match;
-	}
-};
-
-typedef std::list<RecognizedFileType> RecognizedFileTypes;
-
-
 typedef std::list<BGUID> guid_list;
 
 struct ResolvedFileTypeParsers {
@@ -161,6 +122,30 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+class TextFileTypeRecognizer : public GenericFileTypeRecognizer {
+	DECLARE_BOBJECT_CLASS(TextFileTypeRecognizer, BObject)
+
+public:
+	ASSIGN_DESC(IS_FILE_TYPE_RECOGNIZER, wxT("CoreObjects"), 1)
+
+	virtual RecognizedFileType doRecognize(VirtualFile* file, IFile* ifile);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class TextFileTypeParserResolver : public BObject, public FileTypeParserResolver {
+	DECLARE_BOBJECT_CLASS(TextFileTypeParserResolver, BObject)
+
+public:
+	ASSIGN_DESC(IS_FILE_TYPE_RESOLVER, wxT("CoreObjects"), 1)
+
+	virtual ResolvedFileTypeParsers resolve(const BGUID& fileType);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 class BMPFileTypeRecognizer : public GenericFileTypeRecognizer {
 	DECLARE_BOBJECT_CLASS(BMPFileTypeRecognizer, BObject)
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt	2007-07-08 03:08:29 UTC (rev 27956)
@@ -8,6 +8,12 @@
 
 Guidelines:
 
+When creating BObjects, wrap them in RCPtr<>.
+CAUTION: Do *not* create BObjects with bare 'new' and expect them to work. You'll get
+         segfaults! You have to wrap them like this: RCPtr<BObject>(new BObject()),
+         or call addReference()/releaseReference() manually - so that proper
+         initialisation take place (initialize()/destroy()).
+
 When passing an BObject, pass: const RCPtr<BObject>&
 When returning an BObject, return: RCPtr<BObject>
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/common/simplefile.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/common/simplefile.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/common/simplefile.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -99,7 +99,9 @@
 		return false;
 	}
 
-	return feof((FILE *)_handle) != 0;
+	//HACK: this thing is flagged only *after* we try to read past the end of a file
+	//return feof((FILE *)_handle) != 0;
+	return pos() >= size();
 }
 
 uint32 SimpleFile::pos() const {

Added: scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,99 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/common/file.cpp $
+ * $Id: file.cpp 26394 2007-04-06 18:34:53Z agent-q $
+ *
+ */
+
+#include "core_stdafx.h"
+#include "common/common_stdafx.h"
+
+#include "common/xorstream.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+#define error std::cerr <<
+#define debug std::cout <<
+
+namespace Common {
+
+XORStream* XORStream::wrap(byte encbyte, SeekableReadStream* streamImpl, bool ownStream) {
+	if (!streamImpl)
+		return NULL;
+	return new XORStream(encbyte, streamImpl, ownStream);
+}
+
+XORStream::XORStream(byte encbyte, SeekableReadStream* streamImpl, bool ownStream)
+	: _encbyte(encbyte), _streamImpl(streamImpl), _ownStream(ownStream) {
+		ASSERT(_streamImpl);
+}
+
+XORStream::~XORStream() {
+	if (_ownStream)
+		delete _streamImpl;
+}
+
+void XORStream::setencbyte(byte encbyte) {
+	_encbyte = encbyte;
+}
+
+bool XORStream::ioFailed() const {
+	return _streamImpl->ioFailed();
+}
+
+void XORStream::clearIOFailed() {
+	_streamImpl->clearIOFailed();
+}
+
+bool XORStream::eos() const {
+	return _streamImpl->eos();
+}
+
+uint32 XORStream::pos() const {
+	return _streamImpl->pos();
+}
+
+uint32 XORStream::size() const {
+	return _streamImpl->size();
+}
+
+void XORStream::seek(int32 offs, int whence) {
+	return _streamImpl->seek(offs, whence);
+}
+
+uint32 XORStream::read(void *ptr, uint32 len) {
+	if (len == 0)
+		return 0;
+
+	uint32 real_len = _streamImpl->read(ptr, len);
+
+	if (_encbyte == 0)
+		return real_len;
+
+	byte *ptr2 = (byte *)ptr;
+	uint32 t_size = real_len;
+	while (t_size--) {
+		*ptr2++ ^= _encbyte;
+	}
+
+	return real_len;
+}
+
+}	// End of namespace Common


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,66 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/common/file.h $
+ * $Id: file.h 26017 2007-03-08 16:46:02Z fingolfin $
+ *
+ */
+
+#ifndef COMMON_XORSTREAM_H
+#define COMMON_XORSTREAM_H
+
+#include "common/stream.h"
+
+namespace Common {
+
+class XORStream : public SeekableReadStream {
+protected:
+
+	byte _encbyte;
+	bool _ownStream;
+	SeekableReadStream* _streamImpl;
+
+private:
+	// Disallow copying XORStream objects.
+	XORStream(const XORStream &f);
+	XORStream &operator  =(const XORStream &f);
+
+
+public:
+
+	XORStream(byte encbyte, SeekableReadStream* streamImpl, bool ownStream);
+	virtual ~XORStream();
+
+	//returns NULL when given NULL stream
+	static XORStream* wrap(byte encbyte, SeekableReadStream* streamImpl, bool ownStream);
+
+	void setencbyte(byte encbyte);
+
+	bool ioFailed() const;
+	void clearIOFailed();
+
+	bool eos() const;
+	uint32 read(void *dataPtr, uint32 dataSize);
+
+	uint32 pos() const;
+	uint32 size() const;
+	void seek(int32 offs, int whence = SEEK_SET);
+};
+
+} // End of namespace Common
+
+#endif //COMMON_XORSTREAM_H


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/core/common/xorstream.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -22,10 +22,12 @@
 	#define errout std::wcerr
 	#define infoout std::wcout
 	#define streamout std::wostream
+	#define strstreamout std::wostringstream
 #else
 	#define errout std::cerr
 	#define infoout std::cout
 	#define streamout std::ostream
+	#define strstreamout std::ostringstream
 #endif
 
 #define coreString wxString

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ftregistry.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ftregistry.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ftregistry.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -36,7 +36,7 @@
 	//return properly sorted list of fileTypes
 	RecognizedFileTypes recognizeFileType(VirtualFile* file);
 
-	guid_list resolveParsers(VirtualFile* file);
+	guid_list resolveParsers(VirtualFile* file, RecognizedFileType& outFileType);
 
 	ResolvedFileTypeParsers resolveParsers(const BGUID& fileType);
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -317,7 +317,7 @@
 	ordered_objs::reverse_iterator i;
 
 	infoout << wxT("--- ObjectChain::complete() ---") << std::endl;
-	infoout << wxT("--- PINS ---") << std::endl;
+	//infoout << wxT("--- PINS ---") << std::endl;
 
 	//connecting pins with new objects
 next_pin:
@@ -343,14 +343,14 @@
 
 			bool res = connect(RCPtr<BObject>(obj0), RCPtr<BObject>(obj1), desc->interfaceGUID);
 			if (res) {
-				infoout << wxT("    CONNECTED: ") << obj1->get_GUID().identifier
-					<< wxT(" --> ") << desc->interfaceGUID.identifier
-					<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
+				//infoout << wxT("    CONNECTED: ") << obj1->get_GUID().identifier
+				//	<< wxT(" --> ") << desc->interfaceGUID.identifier
+				//	<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
 				goto next_pin; //connected
 			} else {
-				infoout << wxT("    CYCLE?: ") << obj1->get_GUID().identifier
-					<< wxT(" --> ") << desc->interfaceGUID.identifier
-					<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
+				//infoout << wxT("    CYCLE?: ") << obj1->get_GUID().identifier
+				//	<< wxT(" --> ") << desc->interfaceGUID.identifier
+				//	<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
 			}
 		}
 
@@ -363,20 +363,20 @@
 		this->addObject(obj);
 		bool res = connect(RCPtr<BObject>(obj0), obj, desc->interfaceGUID);
 		if (res) {
-			infoout << wxT("    CONNECTED: ") << obj0->get_GUID().identifier
-					  << wxT(" --> ") << desc->interfaceGUID.identifier
-					  << wxT(" --> ") << obj->get_GUID().identifier << std::endl;
+			//infoout << wxT("    CONNECTED: ") << obj0->get_GUID().identifier
+			//		  << wxT(" --> ") << desc->interfaceGUID.identifier
+			//		  << wxT(" --> ") << obj->get_GUID().identifier << std::endl;
 			goto next_pin; //connected
 		} else {
-			infoout << wxT("    CYCLE?: ") << obj0->get_GUID().identifier
-				<< wxT(" --> ") << desc->interfaceGUID.identifier
-				<< wxT(" --> ") << obj->get_GUID().identifier << std::endl;
+			//infoout << wxT("    CYCLE?: ") << obj0->get_GUID().identifier
+			//	<< wxT(" --> ") << desc->interfaceGUID.identifier
+			//	<< wxT(" --> ") << obj->get_GUID().identifier << std::endl;
 		}
 
 		this->removeObject(obj);
 	}
 
-	infoout << wxT("--- SLOTS ---") << std::endl;
+	//infoout << wxT("--- SLOTS ---") << std::endl;
 
 	//connecting slots with existing objects
 next_slot:
@@ -402,19 +402,19 @@
 
 			bool res = connect(RCPtr<BObject>(obj1), RCPtr<BObject>(obj0), desc->interfaceGUID);
 			if (res) {
-				infoout << wxT("    CONNECTED: ") << obj1->get_GUID().identifier
-					<< wxT(" --> ") << desc->interfaceGUID.identifier
-					<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
+				//infoout << wxT("    CONNECTED: ") << obj1->get_GUID().identifier
+				//	<< wxT(" --> ") << desc->interfaceGUID.identifier
+				//	<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
 				goto next_slot; //connected
 			} else {
-				infoout << wxT("    CYCLE?: ") << obj1->get_GUID().identifier
-					<< wxT(" --> ") << desc->interfaceGUID.identifier
-					<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
+				//infoout << wxT("    CYCLE?: ") << obj1->get_GUID().identifier
+				//	<< wxT(" --> ") << desc->interfaceGUID.identifier
+				//	<< wxT(" --> ") << obj0->get_GUID().identifier << std::endl;
 			}
 		}
 	}
 
-	infoout << wxT("--- DONE ---") << std::endl;
+	//infoout << wxT("--- DONE ---") << std::endl;
 }
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -197,6 +197,16 @@
 		infoout << wxT("  ");
 }
 
+#define NO_REALIZE_DEBUG
+#ifdef NO_REALIZE_DEBUG
+
+void BObject::dumpRealizing(ObjectChain* ochain) {}
+void BObject::dumpRealized(ObjectChain* ochain, bool result) {}
+void BObject::dumpUnrealizing(ObjectChain* ochain) {}
+void BObject::dumpUnrealized(ObjectChain* ochain) {}
+
+#else
+
 void BObject::dumpRealizing(ObjectChain* ochain) {
 	dump_realize_indent();
 	infoout << wxT("REALIZING:");
@@ -229,6 +239,8 @@
 	infoout << this->dumpName() << wxT("\t\t") << this << wxT(" oc: ") << ochain << std::endl;
 }
 
+#endif
+
 //do not call manually!
 void BObject::init_pins_slots() {
 	PinSlotDescs::const_iterator i;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -372,7 +372,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // BObject is a reference counted object that is capable of holding pins and slots.
 
-
 class ObjectChain;
 
 class BObject : public RCObject, public GUIDObject {
@@ -460,6 +459,12 @@
 		_realized = false;
 	}
 
+	virtual ObjectChain* getSingleObjectChain() {
+		if (!isRealized(_ochain))
+			return NULL;
+		return _ochain;
+	}
+
 	virtual void dumpObjectChains(streamout& os) {
 	}
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -25,37 +25,41 @@
 // Macros producing the Plugin
 // (see myplugin.h for an example of their output)
 
-#define PLUGIN_DESC(PluginClazz, facility, version) \
+#define PLUGIN_DESC_(PluginClazz, AccName, facility, version) \
  \
 class PluginClazz : public Plugin { \
 public: \
 	GUID_FOR(PluginClazz, facility, version) \
  \
-	virtual const ObjectPlugins& getObjectPlugins() const { \
-		typedef std::pair<const BGUID, ObjectPlugin*> the_pair; \
-		typedef std::pair<ObjectPlugins::iterator, bool> ret_pair; \
-		ASSERT_STATICS_ALLOWED(); \
-		static ObjectPlugins plugins;
-
-#define PLUGGED_OBJECT(ObjectClazz) \
-		static ObjectPluginImpl<ObjectClazz> GENERATE_UNIQUE_IDENTIFIER_SUB(plug); \
-		static ret_pair GENERATE_UNIQUE_IDENTIFIER_SUB(insert) = plugins.insert( \
-			the_pair(  GENERATE_UNIQUE_IDENTIFIER_SUB(plug).get_GUID(), \
-					  &GENERATE_UNIQUE_IDENTIFIER_SUB(plug)) );
-
-#define PLUGIN_END_EX2(PluginClazz, AccName) \
-		return plugins; \
-	} \
+	virtual const ObjectPlugins& getObjectPlugins() const; \
 }; \
  \
 const Plugin& AccName() { \
 	ASSERT_STATICS_ALLOWED(); \
 	static PluginClazz plugin; \
 	return plugin; \
+} \
+ \
+ const Plugin::ObjectPlugins& PluginClazz::getObjectPlugins() const { \
+	typedef std::pair<const BGUID, ObjectPlugin*> the_pair; \
+	typedef std::pair<ObjectPlugins::iterator, bool> ret_pair; \
+	ASSERT_STATICS_ALLOWED(); \
+	static ObjectPlugins plugins;
+
+#define PLUGGED_OBJECT(ObjectClazz) \
+	static ObjectPluginImpl<ObjectClazz> GENERATE_UNIQUE_IDENTIFIER_SUB(plug); \
+	static ret_pair GENERATE_UNIQUE_IDENTIFIER_SUB(insert) = plugins.insert( \
+		the_pair(  GENERATE_UNIQUE_IDENTIFIER_SUB(plug).get_GUID(), \
+				  &GENERATE_UNIQUE_IDENTIFIER_SUB(plug)) );
+
+#define PLUGIN_END \
+	return plugins; \
 }
 
-#define PLUGIN_END_EX(PluginClazz) PLUGIN_END_EX2(PluginClazz, get##PluginClazz)
-#define PLUGIN_END(PluginClazz)    PLUGIN_END_EX2(PluginClazz, getPlugin)
+#define PLUGIN_DESC(PluginClazz, facility, version) \
+	PLUGIN_DESC_(PluginClazz, getPlugin, facility, version)
+#define PLUGIN_DESC_EX(PluginClazz, facility, version) \
+	PLUGIN_DESC_(PluginClazz, get##PluginClazz, facility, version)
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -14,7 +14,7 @@
 }
 
 #define ASSERT_STATICS_ALLOWED() \
-	ASSERT( Browser::statics_allowed )
+	ASSERT( ::Browser::statics_allowed )
 
 #define EMPTY_INITIALIZER
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -10,6 +10,7 @@
 #include "core_stdafx.h"
 
 #include <ostream>
+#include <sstream>
 
 namespace Browser {
 
@@ -18,6 +19,14 @@
 
 template<typename T>
 inline
+wxString toStringEx(const T& obj) {
+	strstreamout ss;
+	ss << obj;
+	return wxString() << ss.str().c_str();
+}
+
+template<typename T>
+inline
 wxString toString(const T& obj) {
 	return wxString() << obj;
 }
@@ -40,18 +49,28 @@
 	return obj;
 }
 
-template<>
 inline
-wxString toString<const char*>(const char *const& str) {
+wxString toString(const char * str) {
 	return wxString(wxConvCurrent->cMB2WX(str));
 }
 
-template<>
 inline
-wxString toString<char*>(char *const& str) {
+wxString toString(char * str) {
 	return wxString(wxConvCurrent->cMB2WX(str));
 }
 
+template<int N>
+inline
+wxString toString(const char str[N]) {
+	return wxString(wxConvCurrent->cMB2WX(str));
+}
+
+template<int N>
+inline
+wxString toString(char str[N]) {
+	return wxString(wxConvCurrent->cMB2WX(str));
+}
+
 #ifndef streamout
 	#error streamout not defined
 #endif

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -71,19 +71,8 @@
 	BObject::doUnrealize(ochain);
 }
 
-bool DirectoryPresenter::prepareKidChain(const RCPtr<VirtualNode>& virtualNode, bool isFile) {
+bool DirectoryPresenter::prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers) {
 
-	//Here we try to figure the fileType and the best parsers for it:
-
-	guid_list parsers;
-	if (isFile)
-		parsers = FileTypeRegistry::get()->resolveParsers(
-										static_cast<VirtualFile*>(virtualNode.get()) );
-	else
-		parsers.push_back( DirectoryPresenter::static_GUID() ); //could omit is - ObjectChain::complete() would find it
-
-	//Ok, we've got the best parsers, so create a dedicated ObjectChain:
-
 	ObjectChain* kidchain = new ObjectChain();
 
 	bool addingOk = true;
@@ -142,7 +131,10 @@
 
 		ExplorationTree::get()->setItemData(kidTreeItem, new VirtualNodeItemData( virtualDir.get() ) );
 
-		prepareKidChain(virtualDir, false);
+		guid_list parsers;
+		//could omit it - ObjectChain::complete() would find it
+		parsers.push_back( DirectoryPresenter::static_GUID() );
+		prepareKidChain(virtualDir, parsers);
 	}
 
 	const std::list<IFile*>& files = _idirectory->getFiles();
@@ -153,11 +145,25 @@
 		wxTreeItemId kidTreeItem = ExplorationTree::get()->appendItem(
 			parent->getTreeItem(), ifile->getName());
 
-		RCPtr<VirtualNode> virtualFile( new VirtualFile(kidTreeItem, ifile) );
+		//CAUTION: Do *not* create BObjects with bare 'new' and expect them to work! you'll get
+		//         segfaults! You have to wrap them like this: RCPtr<BObject>(new BObject()),
+		//         or call addReference()/releaseReference() manually - so that proper
+		//         initialisation take place (initialize()/destroy()).
+		VirtualFile* virtualFile = new VirtualFile(kidTreeItem, ifile);
+		RCPtr<VirtualNode> virtualNode(virtualFile);
 
-		ExplorationTree::get()->setItemData(kidTreeItem, new VirtualNodeItemData( virtualFile.get() ) );
+		ExplorationTree::get()->setItemData(kidTreeItem, new VirtualNodeItemData(virtualFile) );
 
-		prepareKidChain(virtualFile, true);
+		//Here we try to figure the fileType and the best parsers for it:
+
+		RecognizedFileType outFileType(RecognizedFileType::NotRecognized());
+		guid_list parsers;
+		parsers = FileTypeRegistry::get()->resolveParsers(virtualFile, outFileType);
+		ifile->setFileType(outFileType);
+
+		//Ok, we've got the best parsers, so create a dedicated ObjectChain:
+
+		prepareKidChain(virtualNode, parsers);
 	}
 
 	//now realize those chains:

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -6,8 +6,9 @@
 
 #include "pinslot.h"
 #include "ochain.h"
-#include "CoreIntf.h"
+#include "CoreInterfaces.h"
 #include "VirtualNode.h"
+#include "FileTypeRecognizer.h"
 
 #include <list>
 
@@ -46,7 +47,7 @@
 	virtual void deleteKidChains();
 
 	virtual void expand();
-	bool prepareKidChain(const RCPtr<VirtualNode>& virtualNode, bool isFile);
+	bool prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers);
 
 	virtual void dumpObjectChains(streamout& os);
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -184,6 +184,17 @@
 	return _explorationTree;
 }*/
 
+VirtualNode* ExplorationTree::getSelectedNode() {
+	wxTreeItemId item = getSelected();
+	VirtualNode* node = VirtualNodeItemData::getNode(item);
+	return node;
+}
+
+wxTreeItemId ExplorationTree::getSelected() {
+	wxTreeItemId item = _explorationTree->GetSelection();
+	return item;
+}
+
 wxTreeItemId ExplorationTree::appendItem(const wxTreeItemId& parent, wxString title) {
 	ASSERT_VALID_TREE_ITEM(parent);
 	wxTreeItemId item = _explorationTree->AppendItem(parent, title, -1, -1, NULL);

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -53,6 +53,8 @@
 
 	//static wxTreeCtrl* _getTree();
 	//wxTreeCtrl* getTree();
+	VirtualNode* getSelectedNode();
+	wxTreeItemId getSelected();
 	wxTreeItemId appendItem(const wxTreeItemId& parent, wxString title);
 	void _recDel(const wxTreeItemId& item, bool thisToo); //HACK
 	void deleteChildren(const wxTreeItemId& parent);

Copied: scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp (from rev 27944, scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,172 @@
+/////////////////////////////////////////////////////////////////////////////
+// FileInfoPresenter.cpp
+
+#include "gui_stdafx.h"
+
+#include "FileInfoPresenter.h"
+
+#include <wx/filedlg.h>
+#include <wx/wfstream.h>
+
+#include "wx2scstream.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(FileInfoPresenter)
+	PIN_DESC_r(_panelRecieverPin, PIN_DEFAULT, getPanelRecieverImpl, IPanelRecieverImpl)
+END_DESCS
+
+SLOT_DESCS_EX(FileInfoPresenter)
+	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
+END_DESCS
+
+IPanelRecieverImpl* FileInfoPresenter::getPanelRecieverImpl() {
+	//infoout << wxT("TextPresenter::getPanelRecieverImpl(): ") << std::endl;
+	return new IPanelRecieverImpl(this);
+}
+
+
+coreString FileInfoPresenter::getPanelTitle() {
+	return wxT("File Info");
+}
+
+void FileInfoPresenter::panelActivate(wxPanel* panel) {
+	//infoout << wxT("TextPresenter::panelActivate()") << std::endl;
+
+	wxString text = getInfo();
+
+	wxButton *dumpButton;
+	wxTextCtrl *textCtrl;
+	wxBoxSizer *WxBoxSizer1;
+
+	WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
+	panel->SetSizer(WxBoxSizer1);
+	panel->SetAutoLayout(true);
+
+	textCtrl = new wxTextCtrl(panel, wxID_ANY, text, wxPoint(5,5), wxSize(200,200), wxTE_READONLY | wxTE_RICH | wxTE_MULTILINE, wxDefaultValidator, wxT("textCtrl"));
+	//textCtrl->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+	WxBoxSizer1->Add(textCtrl,1,wxALIGN_CENTER | wxEXPAND | wxALL,5);
+
+	dumpButton = new wxButton(panel, wxID_ANY, wxT("Dump File"), wxPoint(167,450), wxSize(75,25), 0, wxDefaultValidator, wxT("dumpButton"));
+	//dumpButton->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+	WxBoxSizer1->Add(dumpButton,0,wxALIGN_LEFT | wxALL,5);
+
+	WxBoxSizer1->Layout();
+	WxBoxSizer1->Fit(panel);
+	WxBoxSizer1->SetSizeHints(panel);
+	//panel->GetParent()->Layout();
+
+	dumpButton->Connect(dumpButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
+		wxCommandEventHandler(DumpFileEvtHandler::dumpButtonClick), NULL, &_evtHelper);
+}
+
+void FileInfoPresenter::panelDeactivate() {
+	//infoout << wxT("TextPresenter::panelDeactivate()") << std::endl;
+}
+
+void DumpFileEvtHandler::dumpButtonClick(wxCommandEvent& event) {
+	_that->dumpFile();
+}
+
+void FileInfoPresenter::dumpFile() {
+	//infoout << wxT("FileInfoPresenter::dumpFile(): ") << std::endl;
+
+	IFile* ifile = _fileSlot->getInterface();
+	if (!ifile) {
+		errout << wxT("FilePresenter::dumpFile(): could not get IFile interface") << std::endl;
+		return;
+	}
+
+	Common::SeekableReadStream* stream = ifile->getStream();
+	if (!stream) {
+		errout << wxT("FilePresenter::dumpFile(): null stream") << std::endl;
+		_fileSlot->releaseInterface();
+		return;
+	}
+
+	wxFileDialog *saveDlg;
+	saveDlg = new wxFileDialog(NULL, wxT("Choose a file"), wxT(""), ifile->getName(), wxT("*.*"), wxSAVE | wxOVERWRITE_PROMPT);
+	int res = saveDlg->ShowModal();
+
+	if (res == wxID_OK) {
+		wxString fileName = saveDlg->GetPath();
+		wxFileOutputStream out(fileName);
+		if (!out.IsOk()) {
+			//errout << wxT("FilePresenter::dumpFile(): could not write file") << std::endl;
+			wxMessageBox(wxString(wxT("Could not open out stream: ")) + fileName,
+				wxT("Dumping File Failed"), wxOK | wxICON_ERROR, NULL);
+		} else {
+			stream->seek(0, SEEK_SET);
+			wxInputStream* input = new wxScummInputStream(stream);
+			out.Write(*input);
+			delete input;
+			if (!out.IsOk() /*HACK: see wxScummInputStream::OnSysRead() || stream->ioFailed()*/) {
+				wxMessageBox(wxString(wxT("Error writing file: ")) + fileName,
+					wxT("Dumping File Failed"), wxOK | wxICON_ERROR, NULL);
+			} else {
+				wxMessageBox(wxString(wxT("Written file: ")) + fileName,
+					wxT("Dumping File"), wxOK | wxICON_INFORMATION, NULL);
+			}
+		}
+	}
+
+	delete saveDlg;
+
+	_fileSlot->releaseInterface();
+}
+
+wxString FileInfoPresenter::getInfo() {
+	//infoout << wxT("FileInfoPresenter::getInfo(): ") << std::endl;
+	IFile* ifile = _fileSlot->getInterface();
+	if (!ifile) {
+		errout << wxT("FilePresenter::getInfo(): could not get IFile interface") << std::endl;
+		return wxT("ERROR: could not get IFile interface");
+	}
+
+	wxString endl(wxT("\n"));
+	wxString text;
+	
+	text << wxT("File name: ") << ifile->getName() << endl;
+	text << wxT("File type: ");
+	if (ifile->getFileType().isOk())
+		text << toStringEx(ifile->getFileType().getFileTypeGUID().identifier) << endl;
+	else
+		text << wxT("Unknown") << endl;
+	IDirectory* idir = ifile->getParentDirectory();
+	if (!idir) {
+		text << wxT("No directory info.") << endl;
+	} else {
+		text << wxT("Parent directory: ") << idir->getName() << endl;
+		text << wxT("Directory type: ");
+		if (idir->getDirectoryFileType().isOk())
+			text << toStringEx(idir->getDirectoryFileType().getFileTypeGUID().identifier) << endl;
+		else
+			text << wxT("Unknown") << endl;
+	}
+
+	Common::SeekableReadStream* stream = ifile->getStream();
+	if (!stream) {
+		text << wxT("ERROR while getting Stream") << endl;
+	} else {
+		uint32 p = stream->pos();
+		uint32 s = stream->size();
+		text << wxT("Size: ") << s << endl;
+		text << wxT("Current position in file: ") << p << endl;
+	}
+
+	_fileSlot->releaseInterface();
+
+	return text;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.h (from rev 27944, scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,60 @@
+/////////////////////////////////////////////////////////////////////////////
+// FileInfoPresenter.h
+
+#ifndef _FILE_INFO_PRESENTER_H_
+#define _FILE_INFO_PRESENTER_H_
+
+#include <wx/wx.h>
+
+#include "PanelProvider.h"
+#include "CoreInterfaces.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class FileInfoPresenter;
+
+struct DumpFileEvtHandler : public wxEvtHandler {
+	FileInfoPresenter* _that;
+	DumpFileEvtHandler(FileInfoPresenter* that)
+		: _that(that) {}
+	void dumpButtonClick(wxCommandEvent& event);
+};
+
+class FileInfoPresenter : public BObject, public PanelReciever {
+	DECLARE_BOBJECT_CLASS(FileInfoPresenter, BObject)
+
+	friend class DumpFileEvtHandler;
+protected:
+	Slot<IFile>* _fileSlot;
+	Pin<IPanelReciever>* _panelRecieverPin;
+
+	DumpFileEvtHandler _evtHelper;
+
+public:
+	ASSIGN_DESC(0, wxT("CoreObjects"), 1)
+
+	PINS_DECL
+	SLOTS_DECL
+
+	FileInfoPresenter()
+	: _evtHelper(this) {}
+
+	virtual coreString getPanelTitle();
+	virtual void panelActivate(wxPanel* panel);
+	virtual void panelDeactivate();
+
+	IPanelRecieverImpl* getPanelRecieverImpl();
+
+	void dumpFile();
+	wxString getInfo();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif //_FILE_INFO_PRESENTER_H_

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,81 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// FilePresenter.cpp
-
-#include "gui_stdafx.h"
-
-#include "FilePresenter.h"
-
-#include "CoreIntf.h"
-
-#include <iostream>
-
-#include "debugmem.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-PIN_DESCS_EX(FilePresenter)
-	PIN_DESC_r(_panelRecieverPin, PIN_DEFAULT, getPanelRecieverImpl, IPanelRecieverImpl)
-END_DESCS
-
-SLOT_DESCS_EX(FilePresenter)
-	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
-END_DESCS
-
-IPanelRecieverImpl* FilePresenter::getPanelRecieverImpl() {
-	//infoout << wxT("FilePresenter::getPanelRecieverImpl(): ") << std::endl;
-	return new IPanelRecieverImpl(this);
-}
-
-
-coreString FilePresenter::getPanelTitle() {
-
-	IFile* ifile = _fileSlot->getInterface();
-	if (!ifile) {
-		errout << wxT("FilePresenter::getPanelTitle(): could not get IFile interface") << std::endl;
-		return wxT("error reading file");
-	}
-
-	coreString name = ifile->getName();
-
-	_fileSlot->releaseInterface();
-
-	return name;
-}
-
-void FilePresenter::panelActivate(wxPanel* panel) {
-	//infoout << wxT("FilePresenter::panelActivate()") << std::endl;
-
-	IFile* ifile = _fileSlot->getInterface();
-	if (!ifile) {
-		errout << wxT("FilePresenter::panelActivate(): could not get IFile interface") << std::endl;
-		return;
-	}
-
-	coreString name = ifile->getName();
-	coreString text = name;
-
-	Common::SeekableReadStream* stream = ifile->getStream();
-	if (stream) {
-		uint32 p = stream->pos();
-		uint32 s = stream->size();
-		text += wxT(" ");
-		text += toString(p) + wxT("/") + toString(s);
-	} else {
-		text += wxT(" ERROR while getting Stream");
-	}
-	new wxStaticText(panel, wxID_ANY, text);
-
-	_fileSlot->releaseInterface();
-}
-
-void FilePresenter::panelDeactivate() {
-	//infoout << wxT("FilePresenter::panelDeactivate()") << std::endl;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,45 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// FilePresenter.h
-
-#ifndef _FILE_PRESENTER_H_
-#define _FILE_PRESENTER_H_
-
-#include <wx/wx.h>
-
-#include "PanelProvider.h"
-#include "CoreIntf.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-class FilePresenter : public BObject, public PanelReciever {
-	DECLARE_BOBJECT_CLASS(FilePresenter, BObject)
-
-protected:
-	Slot<IFile>* _fileSlot;
-	Pin<IPanelReciever>* _panelRecieverPin;
-
-	wxBitmap* _bitmap;
-	wxPanel* _bmpPanel;
-
-public:
-	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
-
-	PINS_DECL
-	SLOTS_DECL
-
-	virtual coreString getPanelTitle();
-	virtual void panelActivate(wxPanel* panel);
-	virtual void panelDeactivate();
-
-	IPanelRecieverImpl* getPanelRecieverImpl();
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser
-
-#endif //_FILE_PRESENTER_H_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -5,7 +5,7 @@
 
 #include "ImagePresenter.h"
 
-#include "GUIIntf.h"
+#include "GUIInterfaces.h"
 #include "BitmapPanel.h"
 
 #include <iostream>

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -7,7 +7,7 @@
 #include <wx/wx.h>
 
 #include "PanelProvider.h"
-#include "GUIIntf.h"
+#include "GUIInterfaces.h"
 
 namespace Browser {
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -50,10 +50,13 @@
 	
 	EVT_CLOSE(MainForm::OnClose)
 	EVT_MENU(wxID_EXIT, MainForm::OnExit)
+	EVT_MENU(ID_DUMPROOTOBJECTCHAIN, MainForm::OnDumpRootObjectChain)
+	EVT_MENU(ID_DUMPCURRENTOBJECTCHAIN, MainForm::OnDumpCurrentObjectChain)
+	EVT_MENU(ID_ACTIVATENODE, MainForm::OnActivateNode)
 	EVT_MENU(ID_TEST1, MainForm::OnTest1)
 	EVT_MENU(ID_TEST1_CLEANUP, MainForm::OnTest1Cleanup)
 	EVT_MENU(ID_TEST0, MainForm::OnTest0)
-	EVT_MENU(ID_DUMPROOTOBJECTCHAIN, MainForm::OnDumpRootObjectChain)
+	EVT_MENU(ID_TEST2, MainForm::OnTest2)
 	
 	EVT_TREE_ITEM_ACTIVATED(ID_BROWSERTREE,MainForm::browserTreeItemActivated)
 	EVT_TREE_ITEM_EXPANDING(ID_BROWSERTREE,MainForm::browserTreeItemExpanding)
@@ -138,12 +141,18 @@
 	ID_FILE_MENU_Mnu_Obj->Append(wxID_EXIT, wxT("Exit"), wxT(""), wxITEM_NORMAL);
 	WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("File"));
 	
-	wxMenu *ID_EDIT_MENU_Mnu_Obj = new wxMenu(0);
-	ID_EDIT_MENU_Mnu_Obj->Append(ID_TEST1, wxT("Test1"), wxT(""), wxITEM_NORMAL);
-	ID_EDIT_MENU_Mnu_Obj->Append(ID_TEST1_CLEANUP, wxT("Test1 Cleanup"), wxT(""), wxITEM_NORMAL);
-	ID_EDIT_MENU_Mnu_Obj->Append(ID_TEST0, wxT("Test0"), wxT(""), wxITEM_NORMAL);
-	ID_EDIT_MENU_Mnu_Obj->Append(ID_DUMPROOTOBJECTCHAIN, wxT("Dump Root Object Chain"), wxT(""), wxITEM_NORMAL);
-	WxMenuBar1->Append(ID_EDIT_MENU_Mnu_Obj, wxT("Edit"));
+	wxMenu *ID_COMMANDS_MENU_Mnu_Obj = new wxMenu(0);
+	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_DUMPROOTOBJECTCHAIN, wxT("Dump Root Object Chain"), wxT(""), wxITEM_NORMAL);
+	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_DUMPCURRENTOBJECTCHAIN, wxT("Dump Current Object Chain"), wxT(""), wxITEM_NORMAL);
+	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_ACTIVATENODE, wxT("Activate Node"), wxT(""), wxITEM_NORMAL);
+	WxMenuBar1->Append(ID_COMMANDS_MENU_Mnu_Obj, wxT("Commands"));
+	
+	wxMenu *ID_TEST_MENU_Mnu_Obj = new wxMenu(0);
+	ID_TEST_MENU_Mnu_Obj->Append(ID_TEST1, wxT("Test1"), wxT(""), wxITEM_NORMAL);
+	ID_TEST_MENU_Mnu_Obj->Append(ID_TEST1_CLEANUP, wxT("Test1 Cleanup"), wxT(""), wxITEM_NORMAL);
+	ID_TEST_MENU_Mnu_Obj->Append(ID_TEST0, wxT("Test0"), wxT(""), wxITEM_NORMAL);
+	ID_TEST_MENU_Mnu_Obj->Append(ID_TEST2, wxT("Test2"), wxT(""), wxITEM_NORMAL);
+	WxMenuBar1->Append(ID_TEST_MENU_Mnu_Obj, wxT("Tests"));
 	SetMenuBar(WxMenuBar1);
 
 	WxSplitterWindow1->SplitVertically(browserTree,mainPanel,329);
@@ -170,22 +179,3 @@
 void MainForm::OnExit(wxCommandEvent& event) {
 	Close(true);
 }
-
-/*
- * browserTreeItemActivated
- */
-void MainForm::browserTreeItemActivated(wxTreeEvent& event) {
-#ifndef NO_BOBJECTS
-	ExplorationTree::get()->itemActivated(event.GetItem());
-#endif
-}
-
-/*
- * browserTreeItemExpanding
- */
-void MainForm::browserTreeItemExpanding(wxTreeEvent& event) {
-#ifndef NO_BOBJECTS
-	ExplorationTree::get()->itemExpanded(event.GetItem());
-#endif
-}
-

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -31,6 +31,10 @@
 #define MainForm_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxTHICK_FRAME | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX
 ////Dialog Style End
 
+namespace Browser {
+class ObjectChain;
+}
+
 class MainForm : public wxFrame
 {
 	private:
@@ -41,6 +45,7 @@
 		virtual ~MainForm();
 		//virtual bool Destroy();
 		void ZCleanup();
+		void dumpObjectChain(Browser::ObjectChain* ochain);
 		void ExitClick(wxCommandEvent& event);
 		void OnTest1Cleanup(wxCommandEvent& event);
 		void OnTest1(wxCommandEvent& event);
@@ -48,6 +53,9 @@
 		void browserTreeItemExpanding(wxTreeEvent& event);
 	void OnTest0(wxCommandEvent& event);
 	void OnDumpRootObjectChain(wxCommandEvent& event);
+	void OnTest2(wxCommandEvent& event);
+	void OnDumpCurrentObjectChain(wxCommandEvent& event);
+	void OnActivateNode(wxCommandEvent& event);
 		
 	private:
 		//Do not add custom control declarations between
@@ -73,11 +81,15 @@
 			////GUI Enum Control ID Start
 			ID_FILE_MENU = 1004,
 			ID_OPEN = 1005,
-			ID_EDIT_MENU = 1010,
+			ID_COMMANDS_MENU = 1025,
+			ID_DUMPROOTOBJECTCHAIN = 1026,
+			ID_DUMPCURRENTOBJECTCHAIN = 1028,
+			ID_ACTIVATENODE = 1029,
+			ID_TEST_MENU = 1010,
 			ID_TEST1 = 1011,
 			ID_TEST1_CLEANUP = 1012,
 			ID_TEST0 = 1022,
-			ID_DUMPROOTOBJECTCHAIN = 1023,
+			ID_TEST2 = 1024,
 			
 			ID_BROWSERNOTEBOOK = 1021,
 			ID_MAINPANEL = 1017,

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,4 +1,4 @@
-object frmNewForm: TfrmNewForm
+object frmNewForm_1: TfrmNewForm
   Left = 8
   Top = 8
   AutoScroll = False
@@ -273,58 +273,103 @@
       437573746F6D4D656E754974656D577261707065720011436172726965642E49
       735375624D656E750812436172726965642E57785F456E61626C656409114361
       72726965642E57785F48696464656E0811436172726965642E57785F49444E61
-      6D65060C49445F454449545F4D454E5512436172726965642E57785F49445661
-      6C756503F20318436172726965642E57785F4D656E754974656D5374796C6507
+      6D65061049445F434F4D4D414E44535F4D454E5512436172726965642E57785F
+      494456616C756503010418436172726965642E57785F4D656E754974656D5374
+      796C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F
+      43617074696F6E0608436F6D6D616E647312436172726965642E57785F436865
+      636B65640816436172726965642E57585F4249544D41502E446174610A0C0000
+      0007544269746D61700000000016436172726965642E57785F46696C65486973
+      746F72790818436172726965642E5778437573746F6D4D656E754974656D0A72
+      04000011000000545778437573746F6D4D656E754974656D5450463018547778
+      437573746F6D4D656E754974656D577261707065720011436172726965642E49
+      735375624D656E750810436172726965642E4556545F4D656E7506154F6E4475
+      6D70526F6F744F626A656374436861696E12436172726965642E57785F456E61
+      626C65640911436172726965642E57785F48696464656E081143617272696564
+      2E57785F49444E616D65061649445F44554D50524F4F544F424A454354434841
+      494E12436172726965642E57785F494456616C75650302041843617272696564
+      2E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D
+      616C12436172726965642E57785F43617074696F6E061644756D7020526F6F74
+      204F626A65637420436861696E12436172726965642E57785F436865636B6564
+      0816436172726965642E57585F4249544D41502E446174610A0C000000075442
+      69746D61700000000016436172726965642E57785F46696C65486973746F7279
+      08000011000000545778437573746F6D4D656E754974656D5450463018547778
+      437573746F6D4D656E754974656D577261707065720011436172726965642E49
+      735375624D656E750810436172726965642E4556545F4D656E7506184F6E4475
+      6D7043757272656E744F626A656374436861696E12436172726965642E57785F
+      456E61626C65640911436172726965642E57785F48696464656E081143617272
+      6965642E57785F49444E616D65061949445F44554D5043555252454E544F424A
+      454354434841494E12436172726965642E57785F494456616C75650304041843
+      6172726965642E57785F4D656E754974656D5374796C65070F77784D6E754974
+      6D5F4E6F726D616C12436172726965642E57785F43617074696F6E061944756D
+      702043757272656E74204F626A65637420436861696E12436172726965642E57
+      785F436865636B65640816436172726965642E57585F4249544D41502E446174
+      610A0C00000007544269746D61700000000016436172726965642E57785F4669
+      6C65486973746F727908000011000000545778437573746F6D4D656E75497465
+      6D5450463018547778437573746F6D4D656E754974656D577261707065720011
+      436172726965642E49735375624D656E750810436172726965642E4556545F4D
+      656E75060E4F6E41637469766174654E6F646512436172726965642E57785F45
+      6E61626C65640911436172726965642E57785F48696464656E08114361727269
+      65642E57785F49444E616D65060F49445F41435449564154454E4F4445124361
+      72726965642E57785F494456616C756503050418436172726965642E57785F4D
+      656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C124361
+      72726965642E57785F43617074696F6E060D4163746976617465204E6F646512
+      436172726965642E57785F436865636B65640816436172726965642E57585F42
+      49544D41502E446174610A0C00000007544269746D6170000000001643617272
+      6965642E57785F46696C65486973746F72790800000000110000005457784375
+      73746F6D4D656E754974656D5450463018547778437573746F6D4D656E754974
+      656D577261707065720011436172726965642E49735375624D656E7508124361
+      72726965642E57785F456E61626C65640911436172726965642E57785F486964
+      64656E0811436172726965642E57785F49444E616D65060C49445F544553545F
+      4D454E5512436172726965642E57785F494456616C756503F203184361727269
+      65642E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F
+      726D616C12436172726965642E57785F43617074696F6E060554657374731243
+      6172726965642E57785F436865636B65640816436172726965642E57585F4249
+      544D41502E446174610A0C00000007544269746D617000000000164361727269
+      65642E57785F46696C65486973746F72790818436172726965642E5778437573
+      746F6D4D656E754974656D0A6305000011000000545778437573746F6D4D656E
+      754974656D5450463018547778437573746F6D4D656E754974656D5772617070
+      65720011436172726965642E49735375624D656E750810436172726965642E45
+      56545F4D656E7506074F6E546573743112436172726965642E57785F456E6162
+      6C65640911436172726965642E57785F48696464656E0811436172726965642E
+      57785F49444E616D65060849445F544553543112436172726965642E57785F49
+      4456616C756503F30318436172726965642E57785F4D656E754974656D537479
+      6C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F43
+      617074696F6E0605546573743112436172726965642E57785F436865636B6564
+      0816436172726965642E57585F4249544D41502E446174610A0C000000075442
+      69746D61700000000016436172726965642E57785F46696C65486973746F7279
+      08000011000000545778437573746F6D4D656E754974656D5450463018547778
+      437573746F6D4D656E754974656D577261707065720011436172726965642E49
+      735375624D656E750810436172726965642E4556545F4D656E75060E4F6E5465
+      737431436C65616E757012436172726965642E57785F456E61626C6564091143
+      6172726965642E57785F48696464656E0811436172726965642E57785F49444E
+      616D65061049445F54455354315F434C45414E555012436172726965642E5778
+      5F494456616C756503F40318436172726965642E57785F4D656E754974656D53
+      74796C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E5778
+      5F43617074696F6E060D546573743120436C65616E757012436172726965642E
+      57785F436865636B65640816436172726965642E57585F4249544D41502E4461
+      74610A0C00000007544269746D61700000000016436172726965642E57785F46
+      696C65486973746F727908000011000000545778437573746F6D4D656E754974
+      656D5450463018547778437573746F6D4D656E754974656D5772617070657200
+      11436172726965642E49735375624D656E750810436172726965642E4556545F
+      4D656E7506074F6E546573743012436172726965642E57785F456E61626C6564
+      0911436172726965642E57785F48696464656E0811436172726965642E57785F
+      49444E616D65060849445F544553543012436172726965642E57785F49445661
+      6C756503FE0318436172726965642E57785F4D656E754974656D5374796C6507
       0F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F43617074
-      696F6E06044564697412436172726965642E57785F436865636B656408164361
-      72726965642E57585F4249544D41502E446174610A0C00000007544269746D61
-      700000000016436172726965642E57785F46696C65486973746F727908184361
-      72726965642E5778437573746F6D4D656E754974656D0A900500001100000054
-      5778437573746F6D4D656E754974656D5450463018547778437573746F6D4D65
-      6E754974656D577261707065720011436172726965642E49735375624D656E75
-      0810436172726965642E4556545F4D656E7506074F6E54657374311243617272
-      6965642E57785F456E61626C65640911436172726965642E57785F4869646465
-      6E0811436172726965642E57785F49444E616D65060849445F54455354311243
-      6172726965642E57785F494456616C756503F30318436172726965642E57785F
-      4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243
-      6172726965642E57785F43617074696F6E060554657374311243617272696564
-      2E57785F436865636B65640816436172726965642E57585F4249544D41502E44
-      6174610A0C00000007544269746D61700000000016436172726965642E57785F
-      46696C65486973746F727908000011000000545778437573746F6D4D656E7549
-      74656D5450463018547778437573746F6D4D656E754974656D57726170706572
-      0011436172726965642E49735375624D656E750810436172726965642E455654
-      5F4D656E75060E4F6E5465737431436C65616E757012436172726965642E5778
-      5F456E61626C65640911436172726965642E57785F48696464656E0811436172
-      726965642E57785F49444E616D65061049445F54455354315F434C45414E5550
-      12436172726965642E57785F494456616C756503F40318436172726965642E57
-      785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C
-      12436172726965642E57785F43617074696F6E060D546573743120436C65616E
-      757012436172726965642E57785F436865636B65640816436172726965642E57
-      585F4249544D41502E446174610A0C00000007544269746D6170000000001643
-      6172726965642E57785F46696C65486973746F72790800001100000054577843
-      7573746F6D4D656E754974656D5450463018547778437573746F6D4D656E7549
-      74656D577261707065720011436172726965642E49735375624D656E75081043
-      6172726965642E4556545F4D656E7506074F6E54657374301243617272696564
-      2E57785F456E61626C65640911436172726965642E57785F48696464656E0811
-      436172726965642E57785F49444E616D65060849445F54455354301243617272
-      6965642E57785F494456616C756503FE0318436172726965642E57785F4D656E
-      754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243617272
-      6965642E57785F43617074696F6E0605546573743012436172726965642E5778
-      5F436865636B65640816436172726965642E57585F4249544D41502E44617461
-      0A0C00000007544269746D61700000000016436172726965642E57785F46696C
-      65486973746F727908000011000000545778437573746F6D4D656E754974656D
-      5450463018547778437573746F6D4D656E754974656D57726170706572001143
-      6172726965642E49735375624D656E750810436172726965642E4556545F4D65
-      6E7506154F6E44756D70526F6F744F626A656374436861696E12436172726965
-      642E57785F456E61626C65640911436172726965642E57785F48696464656E08
-      11436172726965642E57785F49444E616D65061649445F44554D50524F4F544F
-      424A454354434841494E12436172726965642E57785F494456616C756503FF03
-      18436172726965642E57785F4D656E754974656D5374796C65070F77784D6E75
-      49746D5F4E6F726D616C12436172726965642E57785F43617074696F6E061644
-      756D7020526F6F74204F626A65637420436861696E12436172726965642E5778
-      5F436865636B65640816436172726965642E57585F4249544D41502E44617461
-      0A0C00000007544269746D61700000000016436172726965642E57785F46696C
-      65486973746F72790800000000}
+      696F6E0605546573743012436172726965642E57785F436865636B6564081643
+      6172726965642E57585F4249544D41502E446174610A0C00000007544269746D
+      61700000000016436172726965642E57785F46696C65486973746F7279080000
+      11000000545778437573746F6D4D656E754974656D5450463018547778437573
+      746F6D4D656E754974656D577261707065720011436172726965642E49735375
+      624D656E750810436172726965642E4556545F4D656E7506074F6E5465737432
+      12436172726965642E57785F456E61626C65640911436172726965642E57785F
+      48696464656E0811436172726965642E57785F49444E616D65060849445F5445
+      53543212436172726965642E57785F494456616C756503000418436172726965
+      642E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F72
+      6D616C12436172726965642E57785F43617074696F6E06055465737432124361
+      72726965642E57785F436865636B65640816436172726965642E57585F424954
+      4D41502E446174610A0C00000007544269746D61700000000016436172726965
+      642E57785F46696C65486973746F72790800000000}
     Wx_HasHistory = False
   end
 end

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,102 @@
+//---------------------------------------------------------------------------
+//
+// Name:        MainForm.cpp
+// Author:      Zbyl
+// Created:     2007-07-01 11:17:49
+// Description: MainForm class implementation
+//
+//---------------------------------------------------------------------------
+
+#include "gui_stdafx.h"
+
+#include "MainForm.h"
+#include "ExplorationTree.h"
+#include "VirtualNode.h"
+
+#include <iostream>
+#include <fstream>
+
+#include <wx/filedlg.h>
+#include <wx/wfstream.h>
+
+#include "ochain.h"
+
+#include "debugmem.h"
+
+using namespace Browser;
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+ * browserTreeItemActivated
+ */
+void MainForm::browserTreeItemActivated(wxTreeEvent& event) {
+	ExplorationTree::get()->itemActivated(event.GetItem());
+}
+
+/*
+ * browserTreeItemExpanding
+ */
+void MainForm::browserTreeItemExpanding(wxTreeEvent& event) {
+	ExplorationTree::get()->itemExpanded(event.GetItem());
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+void MainForm::dumpObjectChain(ObjectChain* ochain) {
+	ASSERT(ochain);
+
+	wxFileDialog *saveDlg;
+	saveDlg = new wxFileDialog(NULL, wxT("Choose a file"), wxT(""), wxT("ochain.dot"), wxT("*.dot"), wxSAVE | wxOVERWRITE_PROMPT);
+	int res = saveDlg->ShowModal();
+
+	if (res == wxID_OK) {
+		wxString fileName = saveDlg->GetPath();
+
+		std::wfstream file;
+		file.open(fileName.mb_str(), std::ios_base::out | std::ios_base::trunc);
+
+		if (!file.fail())
+			ochain->dumpObjectChainStart(wxString(wxT("ObjectChain")), file);
+
+		if (!file.fail())
+			wxMessageBox(wxString(wxT("Dumped to file: ")) + fileName,
+				wxT("Dump Object Chain"), wxOK | wxICON_INFORMATION, this);
+		else
+			wxMessageBox(wxString(wxT("Failed writing to file: ")) + fileName,
+				wxT("Dump Object Chain Failed"), wxOK | wxICON_ERROR, this);
+	}
+
+	delete saveDlg;
+
+}
+
+void MainForm::OnDumpRootObjectChain(wxCommandEvent& event) {
+	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	dumpObjectChain(rootChain);
+}
+
+/*
+* OnDumpCurrentObjectChain
+*/
+void MainForm::OnDumpCurrentObjectChain(wxCommandEvent& event) {
+	VirtualNode* node = ExplorationTree::get()->getSelectedNode();
+	if (!node)
+		return;
+
+	dumpObjectChain(node->getSingleObjectChain());
+}
+
+/*
+* OnActivateNode
+*/
+void MainForm::OnActivateNode(wxCommandEvent& event) {
+	wxTreeItemId item = ExplorationTree::get()->getSelected();
+	if (item.IsOk())
+		ExplorationTree::get()->itemActivated(item);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -1,89 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// PanelProvider.h
-
-#ifndef _PANEL_PROVIDER_H_
-#define _PANEL_PROVIDER_H_
-
-#include <wx/wx.h>
-
-#include "pinslot.h"
-#include "VirtualNode.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-class PanelReciever {
-public:
-	virtual coreString getPanelTitle() = 0;
-	virtual void panelActivate(wxPanel* panel) = 0;
-	virtual void panelDeactivate() = 0;
-};
-
-class IPanelReciever : public IInterface, public PanelReciever {
-public:
-	GUID_FOR(IPanelReciever, wxT("CoreInterfaces"), 1);
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-//IPanelRecieverImpl delegates method invocations to the apropraiate PanelReciever (_that)
-class IPanelRecieverImpl : public IPanelReciever {
-protected:
-	PanelReciever* _that;
-public:
-	//inherit guid - it's a concrete implementation of an abstract interface
-	IPanelRecieverImpl(PanelReciever* that)
-		: _that(that) {}
-	virtual coreString getPanelTitle() {
-		return _that->getPanelTitle();
-	}
-	virtual void panelActivate(wxPanel* panel) {
-		_that->panelActivate(panel);
-	}
-	virtual void panelDeactivate() {
-		_that->panelDeactivate();
-	}
-	void release() {
-		delete this;
-	}
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-// How the PanelProvider works:
-//  PanelProvider registers itself in ExplorationTree.
-//  PanelProvider is then delegating PanelReciever methods from ExplorationTree,
-//  via IPanelReciever slot, to the proper object.
-
-class PanelProvider : public BObject, public PanelReciever {
-	DECLARE_BOBJECT_CLASS(PanelProvider, BObject)
-
-protected:
-	Slot<IPanelReciever>* _panelRecieverSlot;
-	Slot<INodeProvider>* _nodeSlot;
-
-	IPanelReciever* _ipanelreciever;
-	INodeProvider* _inodeprovider;
-public:
-	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
-
-	SLOTS_DECL
-
-	virtual bool doRealize(ObjectChain* ochain);
-	virtual void doUnrealize(ObjectChain* ochain);
-
-	virtual coreString getPanelTitle();
-	virtual void panelActivate(wxPanel* panel);
-	virtual void panelDeactivate();
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-}
-
-#endif //_PANEL_PROVIDER_H_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -28,9 +28,10 @@
 #include "DirectoryPresenter.h"
 #include "BMPParser.h"
 #include "ImagePresenter.h"
-#include "FilePresenter.h"
+#include "FileInfoPresenter.h"
 #include "PanelProvider.h"
 #include "FileTypeRecognizer.h"
+#include "TextPresenter.h"
 
 //#endif
 
@@ -43,19 +44,20 @@
 
 //#ifndef NO_BOBJECTS
 
-PLUGIN_DESC(Test1Plugin, wxT("MyPlugins"), 1)
+PLUGIN_DESC_EX(Test1Plugin, wxT("MyPlugins"), 1)
 	//PLUGGED_OBJECT(RootDirectory)
 	PLUGGED_OBJECT(DirectoryPresenter)
 	PLUGGED_OBJECT(BMPParser)
 	PLUGGED_OBJECT(ImagePresenter)
-	PLUGGED_OBJECT(FilePresenter)
+	PLUGGED_OBJECT(TextPresenter)
+	PLUGGED_OBJECT(FileInfoPresenter)
 	PLUGGED_OBJECT(PanelProvider)
 
 	PLUGGED_OBJECT(BinaryFileTypeRecognizer)
 	PLUGGED_OBJECT(BinaryFileTypeParserResolver)
 	PLUGGED_OBJECT(BMPFileTypeRecognizer)
 	PLUGGED_OBJECT(BMPFileTypeParserResolver)
-PLUGIN_END_EX(Test1Plugin)
+PLUGIN_END
 
 //#endif
 
@@ -171,29 +173,5 @@
 #endif
 }
 
-
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-
-void MainForm::OnDumpRootObjectChain(wxCommandEvent& event)
-{
-//#ifndef NO_BOBJECTS
-	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
-	ASSERT(rootChain);
-
-	std::wfstream file;
-	file.open(wxString(wxT("rootObjectChain.dot")).mb_str(), std::ios_base::out | std::ios_base::trunc);
-	if (file.fail()) {
-		wxMessageBox(wxT("Could not create file: rootObjectChain.dot."), wxT("DumpRootObjectChain Failed"),
-			wxOK | wxICON_ERROR, this);
-		return;
-	}
-
-	rootChain->dumpObjectChainStart(wxString(wxT("RootObjectChain")), file);
-	wxMessageBox(wxT("Dumped to rootObjectChain.dot."), wxT("DumpRootObjectChain"),
-		wxOK | wxICON_INFORMATION, this);
-//#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,103 @@
+//---------------------------------------------------------------------------
+//
+// Name:        MainForm.cpp
+// Author:      Zbyl
+// Created:     2007-07-01 11:17:49
+// Description: MainForm class implementation
+//
+//---------------------------------------------------------------------------
+
+#include "gui_stdafx.h"
+
+#include "MainForm.h"
+
+#include <wx/filename.h>
+
+#include <iostream>
+#include <fstream>
+
+#include "plugin.h"
+#include "oregistry.h"
+
+#include "ExplorationTree.h"
+#include "VirtualNode.h"
+
+#include "Directories.h"
+#include "DirectoryPresenter.h"
+#include "BMPParser.h"
+#include "ImagePresenter.h"
+#include "FileInfoPresenter.h"
+#include "PanelProvider.h"
+#include "FileTypeRecognizer.h"
+#include "TextPresenter.h"
+
+#include "scumm/ScummParser.h"
+#include "scumm/BlockyBlockPresenter.h"
+#include "scumm/ScummRecognizer.h"
+#include "scumm/ScummBlockPresenter.h"
+
+#include "debugmem.h"
+
+using namespace Browser;
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PLUGIN_DESC_EX(Test2Plugin, wxT("MyPlugins"), 1)
+	//PLUGGED_OBJECT(RootDirectory)
+	PLUGGED_OBJECT(DirectoryPresenter)
+	PLUGGED_OBJECT(ImagePresenter)
+	PLUGGED_OBJECT(TextPresenter)
+	PLUGGED_OBJECT(FileInfoPresenter)
+	PLUGGED_OBJECT(PanelProvider)
+
+	PLUGGED_OBJECT(BMPParser)
+	PLUGGED_OBJECT(TextParser)
+
+	PLUGGED_OBJECT(BinaryFileTypeRecognizer)
+	PLUGGED_OBJECT(BinaryFileTypeParserResolver)
+	PLUGGED_OBJECT(BMPFileTypeRecognizer)
+	PLUGGED_OBJECT(BMPFileTypeParserResolver)
+	PLUGGED_OBJECT(TextFileTypeRecognizer)
+	PLUGGED_OBJECT(TextFileTypeParserResolver)
+
+	//PLUGGED_OBJECT(ScummParser)
+	PLUGGED_OBJECT(BlockyBlockPresenter)
+	PLUGGED_OBJECT(ScummBlockPresenter)
+	PLUGGED_OBJECT(ScummFileTypeRecognizer)
+	PLUGGED_OBJECT(ScummFileTypeParserResolver)
+PLUGIN_END
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+void MainForm::OnTest2(wxCommandEvent& event) {
+
+	OnTest1Cleanup(event);
+	
+	infoout << wxT("Registering Test2 Plugin.") << std::endl;
+	ObjectRegistry::get()->registerPlugin( &getTest2Plugin, false );
+	
+	wxTreeItemId rootItem = ExplorationTree::get()->addRoot(wxT("RootDirectory"));
+
+	RCPtr<RootDirectory> rootDir( new RootDirectory(rootItem) );
+
+	ExplorationTree::get()->setItemData(rootItem, new VirtualNodeItemData( rootDir.get() ) );
+
+	rootDir->addSubDir(wxT("data"), wxT("data"));
+
+	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	rootChain->addObject(rootDir);
+	rootChain->complete();
+
+	bool res = rootChain->realize();
+
+	if (!res) {
+		wxMessageBox(wxT("ObjectChain realisation failed."), wxT("Test2 Failed"),
+			wxOK | wxICON_ERROR, this);
+	}
+
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,88 @@
+/////////////////////////////////////////////////////////////////////////////
+// TextPresenter.cpp
+
+#include "gui_stdafx.h"
+
+#include "TextPresenter.h"
+
+#include "CoreInterfaces.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(TextPresenter)
+	PIN_DESC_r(_panelRecieverPin, PIN_DEFAULT, getPanelRecieverImpl, IPanelRecieverImpl)
+END_DESCS
+
+SLOT_DESCS_EX(TextPresenter)
+	SLOT_DESC(_textSlot, SLOT_DEFAULT)
+END_DESCS
+
+bool TextPresenter::doRealize(ObjectChain* ochain) {
+	bool res = BObject::doRealize(ochain);
+	if (!res)
+		return false;
+
+	_itext = _textSlot->getInterface();
+	if (!_itext) {
+		errout << wxT("TextPresenter::doRealize(): could not get IText interface") << std::endl;
+		_realized = false;
+		return false;
+	}
+
+	return true;
+}
+
+void TextPresenter::doUnrealize(ObjectChain* ochain) {
+	_itext = NULL;
+	_textSlot->releaseInterface();
+
+	BObject::doUnrealize(ochain);
+}
+
+IPanelRecieverImpl* TextPresenter::getPanelRecieverImpl() {
+	//infoout << wxT("TextPresenter::getPanelRecieverImpl(): ") << std::endl;
+	return new IPanelRecieverImpl(this);
+}
+
+
+coreString TextPresenter::getPanelTitle() {
+	return _itext->getTitle();
+}
+
+void TextPresenter::panelActivate(wxPanel* panel) {
+	//infoout << wxT("TextPresenter::panelActivate()") << std::endl;
+
+	const wxString& text = _itext->getText();
+
+	wxTextCtrl *textCtrl;
+	wxBoxSizer *WxBoxSizer1;
+
+	WxBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
+	panel->SetSizer(WxBoxSizer1);
+	panel->SetAutoLayout(true);
+
+	textCtrl = new wxTextCtrl(panel, wxID_ANY, text, wxPoint(5,5), wxSize(400,435), wxTE_READONLY | wxTE_RICH | wxTE_MULTILINE, wxDefaultValidator, wxT("textCtrl"));
+	//textCtrl->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+	WxBoxSizer1->Add(textCtrl,1,wxALIGN_CENTER | wxEXPAND | wxALL,5);
+
+	WxBoxSizer1->Layout();
+	WxBoxSizer1->Fit(panel);
+	WxBoxSizer1->SetSizeHints(panel);
+	//panel->GetParent()->Layout();
+}
+
+void TextPresenter::panelDeactivate() {
+	//infoout << wxT("TextPresenter::panelDeactivate()") << std::endl;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// TextPresenter.h
+
+#ifndef _TEXT_PRESENTER_H_
+#define _TEXT_PRESENTER_H_
+
+#include <wx/wx.h>
+
+#include "PanelProvider.h"
+#include "CoreInterfaces.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class TextPresenter : public BObject, public PanelReciever {
+	DECLARE_BOBJECT_CLASS(TextPresenter, BObject)
+
+protected:
+	Slot<ITextImpl>* _textSlot;
+	Pin<IPanelReciever>* _panelRecieverPin;
+
+	ITextImpl* _itext;
+
+public:
+	ASSIGN_DESC(0, wxT("CoreObjects"), 1)
+
+	PINS_DECL
+	SLOTS_DECL
+
+	TextPresenter()
+	: _itext(NULL) {}
+
+	virtual bool doRealize(ObjectChain* ochain);
+	virtual void doUnrealize(ObjectChain* ochain);
+
+	virtual coreString getPanelTitle();
+	virtual void panelActivate(wxPanel* panel);
+	virtual void panelDeactivate();
+
+	IPanelRecieverImpl* getPanelRecieverImpl();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif //_TEXT_PRESENTER_H_


Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -17,6 +17,50 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+SLOT_DESCS_EX(TextParser)
+	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
+END_DESCS
+PIN_DESCS_EX(TextParser)
+	PIN_DESC_r(_textPin, PIN_DEFAULT | PIN_MULTICAST, getTextImpl, ITextImpl)
+END_DESCS
+
+
+ITextImpl* TextParser::getTextImpl() {
+	//infoout << wxT("TextParser::getTextImpl(): ") << std::endl;
+
+	IFile* ifile = _fileSlot->getInterface();
+	if (!ifile)
+		return NULL;
+	
+	Common::SeekableReadStream* stream = ifile->getStream();
+	
+	if (!stream) {
+		_fileSlot->releaseInterface();
+		return NULL;
+	}
+	
+	uint32 size = stream->size();
+	char* text = new char[size+1];
+	text[size] = '\0';
+	stream->seek(0, SEEK_SET);
+	stream->read(text, size);
+	bool res = !stream->ioFailed();
+
+	_fileSlot->releaseInterface();
+
+	//FIXME: This will read the text in what encoding???
+	wxString str(toString(text));
+	delete [] text;
+
+	if (!res)
+		return NULL;
+
+	return new ITextImpl(ifile->getName(), str);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 SLOT_DESCS_EX(BMPParser)
 	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
 END_DESCS

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h	2007-07-08 03:08:29 UTC (rev 27956)
@@ -6,14 +6,33 @@
 
 #include "pinslot.h"
 
-#include "GUIIntf.h"
-#include "CoreIntf.h"
+#include "GUIInterfaces.h"
+#include "CoreInterfaces.h"
 
 namespace Browser {
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+class TextParser : public BObject {
+	DECLARE_BOBJECT_CLASS(TextParser, BObject)
+
+protected:
+	Slot<IFile>* _fileSlot;
+	Pin<IText>* _textPin;
+
+public:
+	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
+
+	PINS_DECL
+	SLOTS_DECL
+
+	ITextImpl* getTextImpl();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 class BMPParser : public BObject {
 	DECLARE_BOBJECT_CLASS(BMPParser, BObject)
 
@@ -27,8 +46,6 @@
 	PINS_DECL
 	SLOTS_DECL
 
-	BMPParser() {}
-
 	IImageImpl* getImageImpl();
 	void releaseImageImpl(IImageImpl* iface);
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp	2007-07-08 02:33:47 UTC (rev 27955)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp	2007-07-08 03:08:29 UTC (rev 27956)
@@ -4,13 +4,12 @@
 #include "plugins_stdafx.h"
 
 #include "Directories.h"
+#include "CoreFileTypes.h"
 
 #include "common/simplefile.h"
 
 #include <iostream>
 
-#include <stdlib.h>
-
 #include <wx/filesys.h>
 #include <wx/filename.h>
 
@@ -23,95 +22,74 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class IDirectoryImpl : public IDirectory {
+//A directory implementation, whose contents are initialized with addFile(), addSubDir(),
+//and which creates *IDiskFileImpl* and *IDiskDirectoryImpl*.
+//So it's a "virtual" directory.

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list