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

zbychs at users.sourceforge.net zbychs at users.sourceforge.net
Wed Jul 11 16:07:34 CEST 2007


Revision: 28030
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28030&view=rev
Author:   zbychs
Date:     2007-07-11 07:07:33 -0700 (Wed, 11 Jul 2007)

Log Message:
-----------
Changing the project structure.
The building is broken at the moment.
Last good version is 28025.

Modified Paths:
--------------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.cpp

Added Paths:
-----------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h

Removed Paths:
-------------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/common/

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,49 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// CoreFileTypes.cpp
-
-#include "core_stdafx.h"
-
-#include "CoreFileTypes.h"
-
-#include "debugmem.h"
-
-namespace Browser {
-
-namespace CoreFileTypes {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// FileTypes
-
-SAFE_STATIC(binaryFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Binary File"), 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)) )
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// Presenters TODO: move it to a different header
-
-SAFE_STATIC(fileInfoPresenterGUID, BGUID, (wxT("CoreObjects"), wxT("FileInfoPresenter"), 1) )
-
-SAFE_STATIC(textParserGUID, BGUID, (wxT("CoreObjects"), wxT("TextParser"), 1) )
-SAFE_STATIC(binaryParserGUID, BGUID, (wxT("CoreObjects"), wxT("BinaryParser"), 1) )
-SAFE_STATIC(bmpParserGUID, BGUID, (wxT("CoreObjects"), wxT("BMPParser"), 1) )
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace CoreFileTypes
-
-} // namespace Browser

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,50 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// CoreFileTypes.h
-
-#ifndef _CORE_FILE_TYPES_H_
-#define _CORE_FILE_TYPES_H_
-
-#include "guid.h"
-#include "FileType.h"
-
-#include "safe_static.h"
-
-namespace Browser {
-
-namespace CoreFileTypes {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// FileTypes
-
-SAFE_STATIC_DECL(binaryFileTypeGUID, 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)
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-// Presenters TODO: move it to a different header
-
-SAFE_STATIC_DECL(fileInfoPresenterGUID, BGUID)
-
-SAFE_STATIC_DECL(textParserGUID, BGUID)
-SAFE_STATIC_DECL(binaryParserGUID, BGUID)
-SAFE_STATIC_DECL(bmpParserGUID, BGUID)
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace CoreFileTypes
-
-} // namespace Browser
-
-#endif // _CORE_FILE_TYPES_H_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CoreInterfaces.cpp
 
-#include "core_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "CoreInterfaces.h"
 #include "CoreFileTypes.h"

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -4,8 +4,6 @@
 #ifndef _CORE_INTERFACES_H_
 #define _CORE_INTERFACES_H_
 
-#include "core_stdafx.h"
-
 #include "pinslot.h"
 #include "FileType.h"
 
@@ -201,79 +199,6 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-//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 bool isMonospace() = 0;
-	virtual const wxString& getTitle() = 0;
-	virtual const wxString& getText() = 0;
-	virtual void release() {
-		delete this;
-	}
-};
-
-class ITextImpl : public IText {
-	wxString _title;
-	wxString _text;
-	bool _monospace;
-public:
-	ITextImpl(const wxString& title, const wxString& text, bool monospace = false)
-		: _title(title), _text(text), _monospace(monospace) {}
-
-	virtual bool isMonospace() {
-		return _monospace;
-	}
-	virtual void setMonospace(bool monospace) {
-		_monospace = monospace;
-	}
-	virtual const wxString& getTitle() {
-		return _title;
-	}
-	virtual const wxString& getText() {
-		return _text;
-	}
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-//to be used by HtmlPresenter, so it has a title and url
-class IUrl : public IInterface {
-public:
-	GUID_FOR(IUrl, wxT("CoreInterfaces"), 1);
-	virtual bool isEmpty() = 0;
-	virtual const wxString& getTitle() = 0;
-	virtual const wxString& getUrl() = 0;
-	virtual void release() {
-		delete this;
-	}
-};
-
-class IUrlImpl : public IUrl {
-	wxString _title;
-	wxString _url;
-	bool _empty;
-public:
-	IUrlImpl(const wxString& title)
-		: _title(title), _empty(true) {}
-	IUrlImpl(const wxString& title, const wxString& url)
-		: _title(title), _url(url), _empty(false) {}
-
-	virtual bool isEmpty() {
-		return _empty;
-	}
-	virtual const wxString& getTitle() {
-		return _title;
-	}
-	virtual const wxString& getUrl() {
-		return _url;
-	}
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
 } // namespace Browser
 
 #endif // _CORE_INTERFACES_H_

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,240 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// DirectoryPresenter.cpp
-
-#include "gui_stdafx.h"
-
-#include "DirectoryPresenter.h"
-#include "ExplorationTree.h"
-//#include "FilePresenter.h"
-#include "oregistry.h"
-#include "ftregistry.h"
-
-#include <iostream>
-
-#include "debugmem.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-SLOT_DESCS_EX(DirectoryPresenter)
-	SLOT_DESC(_directorySlot, SLOT_DEFAULT)
-	SLOT_DESC(_nodeSlot, SLOT_DEFAULT)
-END_DESCS
-
-bool DirectoryPresenter::doRealize(ObjectChain* ochain) {
-	bool res = BObject::doRealize(ochain);
-	if (!res)
-		return false;
-
-	_inodeprovider = _nodeSlot->getInterface();
-	if (!_inodeprovider) {
-		_realized = false;
-		return false;
-	}
-
-	VirtualNode* node = _inodeprovider->getNode();
-	ExplorationTree::get()->registerDirectoryPresenter(node, this);
-	//ExplorationTree::get()->setItemHasChildren(node, true);
-
-	//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
-	//wxTreeItemId dummyTreeItem = ExplorationTree::get()->appendItem(
-	//	node->getTreeItem(), wxT("Dummy"));
-
-	_expanded = false;
-
-	return true;
-}
-
-void DirectoryPresenter::doUnrealize(ObjectChain* ochain) {
-	ASSERT(_inodeprovider && _inodeprovider->getNode());
-	infoout << wxT("DirectoryPresenter::unrealize(): ")
-			  //<< (_inodeprovider ? _inodeprovider->getNode()->getTreeItemName().c_str() : wxT("<error>")) << wxT(" ")
-			  << (_idirectory ? _idirectory->getName().c_str() : wxT("<not expanded>")) << wxT(" ")
-			  << std::endl;
-
-	ExplorationTree::get()->unregisterDirectoryPresenter(this);
-
-	deleteKidChains();
-
-	_expanded = false;
-	_idirectory = NULL;
-	_inodeprovider = NULL;
-
-	_directorySlot->releaseInterface();
-	_nodeSlot->releaseInterface();
-
-	BObject::doUnrealize(ochain);
-}
-
-ObjectChain* DirectoryPresenter::prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers) {
-
-	ObjectChain* kidchain = new ObjectChain();
-
-	bool addingOk = true;
-
-	addingOk &= kidchain->addObject(virtualNode);
-
-	guid_list::iterator i;
-	for (i = parsers.begin(); i != parsers.end(); ++i) {
-		if (!addingOk)
-			break;
-		RCPtr<BObject> parser = ObjectRegistry::get()->getObject( *i );
-		if (parser.get() == NULL) {
-			errout << wxT("ERROR: DirectoryPresenter::prepareKidChain(): can't create parser: ") << (*i) << std::endl;
-			addingOk = false;
-			break;
-		}
-		addingOk &= kidchain->addObject( parser );
-	}
-
-	if (!addingOk) {
-		//ASSERT(false); //failure here means we've got a missing plugin
-		delete kidchain;
-		//virtualNode is deleted automatically
-		return NULL;
-	}
-
-	return kidchain;
-}
-
-void DirectoryPresenter::expand() {
-
-	if (_expanded)
-		return;
-	_expanded = true;
-
-	VirtualNode* parent = _inodeprovider->getNode();
-	ExplorationTree::get()->deleteChildren(parent->getTreeItem()); //delete the Dummy added by the ExplorationTree
-
-	_idirectory = _directorySlot->getInterface();
-	if (!_idirectory) {
-		errout << wxT("ERROR: DirectoryPresenter::expand(): can't get IDirectory interface.") << std::endl;
-		return; //TODO: report error
-	}
-
-	infoout << wxT("DirectoryPresenter::expand(): ") << _idirectory->getName().c_str() << std::endl;
-
-	const std::list<IDirectory*>& subdirs = _idirectory->getSubDirs();
-	std::list<IDirectory*>::const_iterator j;
-	for (j = subdirs.begin(); j != subdirs.end(); ++j) {
-		IDirectory* idirectory = *j;
-
-		wxTreeItemId kidTreeItem = ExplorationTree::get()->appendItem(
-			parent->getTreeItem(), idirectory->getName());
-
-		RCPtr<VirtualNode> virtualDir( new VirtualDirectory(kidTreeItem, idirectory) );
-
-		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualDir.get(), NULL);
-		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
-
-		guid_list parsers;
-		//could omit it - ObjectChain::complete() would find it
-		parsers.push_back( DirectoryPresenter::static_GUID() );
-
-		ObjectChain* kidchain = prepareKidChain(virtualDir, parsers);
-		if (!kidchain) {
-			errout << wxT("ERROR: DirectoryPresenter::expand(): can't prepare kid chain for dir: ")
-				<< idirectory->getName() << std::endl;
-			ExplorationTree::get()->deleteItem(kidTreeItem);
-		} else {
-			itemData->setObjectChain(kidchain);
-			_kidChains.push_back(itemData);
-		}
-	}
-
-	const std::list<IFile*>& files = _idirectory->getFiles();
-	std::list<IFile*>::const_iterator i;
-	for (i = files.begin(); i != files.end(); ++i) {
-		IFile* ifile = *i;
-
-		wxTreeItemId kidTreeItem = ExplorationTree::get()->appendItem(
-			parent->getTreeItem(), ifile->getName());
-
-		//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);
-
-		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualFile, NULL);
-		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
-
-		//Here we try to figure the fileType and the best parsers for it:
-
-		RecognizedFileType outFileType(ifile->getFileType());
-		guid_list parsers;
-		if (outFileType.isOk())
-			parsers = FileTypeRegistry::get()->resolveParsers(outFileType.getFileTypeGUID())._parserGUIDs;
-		else {
-			parsers = FileTypeRegistry::get()->resolveParsers(virtualFile, outFileType);
-			ifile->setFileType(outFileType);
-		}
-
-		//Ok, we've got the best parsers, so create a dedicated ObjectChain:
-
-		ObjectChain* kidchain = prepareKidChain(virtualNode, parsers);
-		if (!kidchain) {
-			errout << wxT("ERROR: DirectoryPresenter::expand(): can't prepare kid chain for file: ")
-				<< ifile->getName() << wxT(" file type: ") << outFileType.getFileTypeGUID() << std::endl;
-			ExplorationTree::get()->deleteItem(kidTreeItem);
-		} else {
-			itemData->setObjectChain(kidchain);
-			_kidChains.push_back(itemData);
-		}
-	}
-
-	//realize visible items:
-	//ExplorationTree::get()->realizeVisible(); done by the tree itself
-
-	//now realize those chains:
-	/*if (!realizeKidChains()) {
-		deleteKidChains();
-		errout << wxT("ERROR: DirectoryPresenter::expand(): can't realize kids.") << std::endl;
-		return; //TODO: report error
-	}*/
-}
-
-void DirectoryPresenter::deleteKidChains() {
-	std::list<VirtualNodeItemData*>::const_iterator i;
-	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
-		VirtualNodeItemData* data = *i;
-		ObjectChain* kidchain = data->getObjectChain();
-		ASSERT(kidchain);
-		delete kidchain; //unrealize
-	}
-	_kidChains.clear();
-
-	VirtualNode* node = _inodeprovider->getNode();
-	ExplorationTree::get()->deleteChildren(node->getTreeItem());
-}
-
-bool DirectoryPresenter::realizeKidChains() {
-	bool res = true;
-	/*std::list<ObjectChain*>::const_iterator i;
-	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
-		ObjectChain* kidchain = *i;
-		kidchain->complete();
-		res &= kidchain->realize();
-	}*/
-	return res;
-}
-
-void DirectoryPresenter::dumpObjectChains(streamout& os) {
-	std::list<VirtualNodeItemData*>::const_iterator i;
-	int idx = 0;
-	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
-		VirtualNodeItemData* data = *i;
-		ObjectChain* kidchain = data->getObjectChain();
-		ASSERT(kidchain);
-		kidchain->dumpObjectChain(coreString(wxT("kid")) + toString(idx), os);
-		idx++;
-	}
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-}

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.h	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,62 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// DirectoryPresenter.h
-
-#ifndef _DIRECTORY_PRESENTER_H_
-#define _DIRECTORY_PRESENTER_H_
-
-#include "pinslot.h"
-#include "ochain.h"
-#include "CoreInterfaces.h"
-#include "VirtualNode.h"
-#include "FileTypeRecognizer.h"
-#include "DirectoryController.h"
-
-#include <list>
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-class INodeProvider;
-
-class DirectoryPresenter : public BObject, public DirectoryController {
-	DECLARE_BOBJECT_CLASS(DirectoryPresenter, BObject)
-
-protected:
-	Slot<IDirectory>* _directorySlot;
-	Slot<INodeProvider>* _nodeSlot;
-
-	IDirectory* _idirectory;
-	INodeProvider* _inodeprovider;
-	std::list<VirtualNodeItemData*> _kidChains;
-
-	bool _expanded;
-
-public:
-	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
-
-	SLOTS_DECL
-
-	DirectoryPresenter()
-	: _idirectory(NULL), _inodeprovider(NULL), _expanded(false) {}
-
-	virtual bool doRealize(ObjectChain* ochain);
-	virtual void doUnrealize(ObjectChain* ochain);
-
-	virtual bool realizeKidChains();
-	virtual void deleteKidChains();
-
-	virtual void expand();
-	ObjectChain* prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers);
-
-	virtual void dumpObjectChains(streamout& os);
-
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-}
-
-#endif //_DIRECTORY_PRESENTER_H_

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,42 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// DiskFileProvider.cpp
-
-#include "plugins_stdafx.h"
-
-#include "DiskFileProvider.h"
-#include "common/simplefile.h"
-
-#include <iostream>
-
-#include "debugmem.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-PIN_DESCS_EX(DiskFileProvider)
-	PIN_DESC(_filePin, PIN_MULTICAST, getFileImpl, releaseFileImpl)
-END_DESCS
-
-
-IStreamFileImpl* DiskFileProvider::getFileImpl() {
-	//infoout << wxT("DiskFileProvider::getFileImpl(): ") << _diskFileName << std::endl;
-	Common::SimpleFile* file = new Common::SimpleFile();
-	bool res = file->open(_diskFileName);
-	if (!res) {
-		delete file;
-		return NULL;
-	}
-	return new IStreamFileImpl(NULL, _diskFileName, file, true);
-}
-
-void DiskFileProvider::releaseFileImpl(IStreamFileImpl* iface) {
-	//infoout << wxT("DiskFileProvider::releaseFileImpl(): ") << _diskFileName << std::endl;
-	delete iface;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.h	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -1,49 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// DiskFileProvider.h
-
-// This class in unused, although potentially usable.
-
-#ifndef _DISKFILEPROVIDER_H_
-#define _DISKFILEPROVIDER_H_
-
-#include "pinslot.h"
-
-#include "CoreInterfaces.h"
-
-namespace Browser {
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-class DiskFileProvider : public BObject {
-	DECLARE_BOBJECT_CLASS(DiskFileProvider, BObject)
-
-protected:
-	Pin<IFile>* _filePin;
-
-	coreString _diskFileName;
-
-public:
-	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
-
-	PINS_DECL
-
-	DiskFileProvider() {}
-	DiskFileProvider(coreString diskFileName)
-		: _diskFileName(diskFileName) {}
-
-	virtual void init(coreString diskFileName) {
-		_diskFileName = diskFileName;
-	}
-
-	IStreamFileImpl* getFileImpl();
-	void releaseFileImpl(IStreamFileImpl* iface);
-
-};
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-} // namespace Browser
-
-#endif // _DISKFILEPROVIDER_H_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -194,7 +194,9 @@
 		_notCompletedCount--;
 		data->setCompleted(true);
 
-		//FIXME: This won't work for other DirectoryControllers
+		//FIXME: chanhe the _notCompletedCount to a list of not completed nodes
+
+		//FIXME: This won't work for other DirectoryControllers - search for IS_DIRECTORY_CONTROLLER
 		ASSERT_STATICS_ALLOWED();
 		static directoryPresenterGUID(wxT("CoreObjects"), wxT("DirectoryController"), 1);
 		//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.cpp	2007-07-11 13:48:53 UTC (rev 28029)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -2,7 +2,7 @@
 // PinSlot.pch will be the pre-compiled header
 // stdafx.obj will contain the pre-compiled type information
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 // TODO: reference any additional headers you need in STDAFX.H
 // and not in this file

Copied: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams (from rev 28029, scummex/branches/gsoc2007-gameresbrowser/src/common)

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.cpp (from rev 28026, scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// AuxInterfaces.cpp
+
+#include "plugins_stdafx.h"
+
+#include "AuxInterfaces.h"
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Concrete implementations of the interfaces
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.h (from rev 28026, scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/AuxInterfaces.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,89 @@
+/////////////////////////////////////////////////////////////////////////////
+// AuxInterfaces.h
+
+#ifndef _AUX_INTERFACES_H_
+#define _AUX_INTERFACES_H_
+
+#include "pinslot.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//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 bool isMonospace() = 0;
+	virtual const wxString& getTitle() = 0;
+	virtual const wxString& getText() = 0;
+	virtual void release() {
+		delete this;
+	}
+};
+
+class ITextImpl : public IText {
+	wxString _title;
+	wxString _text;
+	bool _monospace;
+public:
+	ITextImpl(const wxString& title, const wxString& text, bool monospace = false)
+		: _title(title), _text(text), _monospace(monospace) {}
+
+	virtual bool isMonospace() {
+		return _monospace;
+	}
+	virtual void setMonospace(bool monospace) {
+		_monospace = monospace;
+	}
+	virtual const wxString& getTitle() {
+		return _title;
+	}
+	virtual const wxString& getText() {
+		return _text;
+	}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//to be used by HtmlPresenter, so it has a title and url
+class IUrl : public IInterface {
+public:
+	GUID_FOR(IUrl, wxT("CoreInterfaces"), 1);
+	virtual bool isEmpty() = 0;
+	virtual const wxString& getTitle() = 0;
+	virtual const wxString& getUrl() = 0;
+	virtual void release() {
+		delete this;
+	}
+};
+
+class IUrlImpl : public IUrl {
+	wxString _title;
+	wxString _url;
+	bool _empty;
+public:
+	IUrlImpl(const wxString& title)
+		: _title(title), _empty(true) {}
+	IUrlImpl(const wxString& title, const wxString& url)
+		: _title(title), _url(url), _empty(false) {}
+
+	virtual bool isEmpty() {
+		return _empty;
+	}
+	virtual const wxString& getTitle() {
+		return _title;
+	}
+	virtual const wxString& getUrl() {
+		return _url;
+	}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif // _AUX_INTERFACES_H_

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.cpp (from rev 28026, scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,49 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreFileTypes.cpp
+
+#include "core_stdafx.h"
+
+#include "CoreFileTypes.h"
+
+#include "debugmem.h"
+
+namespace Browser {
+
+namespace CoreFileTypes {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// FileTypes
+
+SAFE_STATIC(binaryFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Binary File"), 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)) )
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Presenters TODO: move it to a different header
+
+SAFE_STATIC(fileInfoPresenterGUID, BGUID, (wxT("CoreObjects"), wxT("FileInfoPresenter"), 1) )
+
+SAFE_STATIC(textParserGUID, BGUID, (wxT("CoreObjects"), wxT("TextParser"), 1) )
+SAFE_STATIC(binaryParserGUID, BGUID, (wxT("CoreObjects"), wxT("BinaryParser"), 1) )
+SAFE_STATIC(bmpParserGUID, BGUID, (wxT("CoreObjects"), wxT("BMPParser"), 1) )
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace CoreFileTypes
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.h (from rev 28026, scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/CoreFileTypes.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreFileTypes.h
+
+#ifndef _CORE_FILE_TYPES_H_
+#define _CORE_FILE_TYPES_H_
+
+#include "guid.h"
+#include "FileType.h"
+
+#include "safe_static.h"
+
+namespace Browser {
+
+namespace CoreFileTypes {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// FileTypes
+
+SAFE_STATIC_DECL(binaryFileTypeGUID, 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)
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Presenters TODO: move it to a different header
+
+SAFE_STATIC_DECL(fileInfoPresenterGUID, BGUID)
+
+SAFE_STATIC_DECL(textParserGUID, BGUID)
+SAFE_STATIC_DECL(binaryParserGUID, BGUID)
+SAFE_STATIC_DECL(bmpParserGUID, BGUID)
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace CoreFileTypes
+
+} // namespace Browser
+
+#endif // _CORE_FILE_TYPES_H_

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.cpp (from rev 28029, scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,240 @@
+/////////////////////////////////////////////////////////////////////////////
+// DirectoryPresenter.cpp
+
+#include "gui_stdafx.h"
+
+#include "DirectoryPresenter.h"
+#include "ExplorationTree.h"
+//#include "FilePresenter.h"
+#include "oregistry.h"
+#include "ftregistry.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+SLOT_DESCS_EX(DirectoryPresenter)
+	SLOT_DESC(_directorySlot, SLOT_DEFAULT)
+	SLOT_DESC(_nodeSlot, SLOT_DEFAULT)
+END_DESCS
+
+bool DirectoryPresenter::doRealize(ObjectChain* ochain) {
+	bool res = BObject::doRealize(ochain);
+	if (!res)
+		return false;
+
+	_inodeprovider = _nodeSlot->getInterface();
+	if (!_inodeprovider) {
+		_realized = false;
+		return false;
+	}
+
+	VirtualNode* node = _inodeprovider->getNode();
+	ExplorationTree::get()->registerDirectoryPresenter(node, this);
+	//ExplorationTree::get()->setItemHasChildren(node, true);
+
+	//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
+	//wxTreeItemId dummyTreeItem = ExplorationTree::get()->appendItem(
+	//	node->getTreeItem(), wxT("Dummy"));
+
+	_expanded = false;
+
+	return true;
+}
+
+void DirectoryPresenter::doUnrealize(ObjectChain* ochain) {
+	ASSERT(_inodeprovider && _inodeprovider->getNode());
+	infoout << wxT("DirectoryPresenter::unrealize(): ")
+			  //<< (_inodeprovider ? _inodeprovider->getNode()->getTreeItemName().c_str() : wxT("<error>")) << wxT(" ")
+			  << (_idirectory ? _idirectory->getName().c_str() : wxT("<not expanded>")) << wxT(" ")
+			  << std::endl;
+
+	ExplorationTree::get()->unregisterDirectoryPresenter(this);
+
+	deleteKidChains();
+
+	_expanded = false;
+	_idirectory = NULL;
+	_inodeprovider = NULL;
+
+	_directorySlot->releaseInterface();
+	_nodeSlot->releaseInterface();
+
+	BObject::doUnrealize(ochain);
+}
+
+ObjectChain* DirectoryPresenter::prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers) {
+
+	ObjectChain* kidchain = new ObjectChain();
+
+	bool addingOk = true;
+
+	addingOk &= kidchain->addObject(virtualNode);
+
+	guid_list::iterator i;
+	for (i = parsers.begin(); i != parsers.end(); ++i) {
+		if (!addingOk)
+			break;
+		RCPtr<BObject> parser = ObjectRegistry::get()->getObject( *i );
+		if (parser.get() == NULL) {
+			errout << wxT("ERROR: DirectoryPresenter::prepareKidChain(): can't create parser: ") << (*i) << std::endl;
+			addingOk = false;
+			break;
+		}
+		addingOk &= kidchain->addObject( parser );
+	}
+
+	if (!addingOk) {
+		//ASSERT(false); //failure here means we've got a missing plugin
+		delete kidchain;
+		//virtualNode is deleted automatically
+		return NULL;
+	}
+
+	return kidchain;
+}
+
+void DirectoryPresenter::expand() {
+
+	if (_expanded)
+		return;
+	_expanded = true;
+
+	VirtualNode* parent = _inodeprovider->getNode();
+	ExplorationTree::get()->deleteChildren(parent->getTreeItem()); //delete the Dummy added by the ExplorationTree
+
+	_idirectory = _directorySlot->getInterface();
+	if (!_idirectory) {
+		errout << wxT("ERROR: DirectoryPresenter::expand(): can't get IDirectory interface.") << std::endl;
+		return; //TODO: report error
+	}
+
+	infoout << wxT("DirectoryPresenter::expand(): ") << _idirectory->getName().c_str() << std::endl;
+
+	const std::list<IDirectory*>& subdirs = _idirectory->getSubDirs();
+	std::list<IDirectory*>::const_iterator j;
+	for (j = subdirs.begin(); j != subdirs.end(); ++j) {
+		IDirectory* idirectory = *j;
+
+		wxTreeItemId kidTreeItem = ExplorationTree::get()->appendItem(
+			parent->getTreeItem(), idirectory->getName());
+
+		RCPtr<VirtualNode> virtualDir( new VirtualDirectory(kidTreeItem, idirectory) );
+
+		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualDir.get(), NULL);
+		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
+
+		guid_list parsers;
+		//could omit it - ObjectChain::complete() would find it
+		parsers.push_back( DirectoryPresenter::static_GUID() );
+
+		ObjectChain* kidchain = prepareKidChain(virtualDir, parsers);
+		if (!kidchain) {
+			errout << wxT("ERROR: DirectoryPresenter::expand(): can't prepare kid chain for dir: ")
+				<< idirectory->getName() << std::endl;
+			ExplorationTree::get()->deleteItem(kidTreeItem);
+		} else {
+			itemData->setObjectChain(kidchain);
+			_kidChains.push_back(itemData);
+		}
+	}
+
+	const std::list<IFile*>& files = _idirectory->getFiles();
+	std::list<IFile*>::const_iterator i;
+	for (i = files.begin(); i != files.end(); ++i) {
+		IFile* ifile = *i;
+
+		wxTreeItemId kidTreeItem = ExplorationTree::get()->appendItem(
+			parent->getTreeItem(), ifile->getName());
+
+		//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);
+
+		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualFile, NULL);
+		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
+
+		//Here we try to figure the fileType and the best parsers for it:
+
+		RecognizedFileType outFileType(ifile->getFileType());
+		guid_list parsers;
+		if (outFileType.isOk())
+			parsers = FileTypeRegistry::get()->resolveParsers(outFileType.getFileTypeGUID())._parserGUIDs;
+		else {
+			parsers = FileTypeRegistry::get()->resolveParsers(virtualFile, outFileType);
+			ifile->setFileType(outFileType);
+		}
+
+		//Ok, we've got the best parsers, so create a dedicated ObjectChain:
+
+		ObjectChain* kidchain = prepareKidChain(virtualNode, parsers);
+		if (!kidchain) {
+			errout << wxT("ERROR: DirectoryPresenter::expand(): can't prepare kid chain for file: ")
+				<< ifile->getName() << wxT(" file type: ") << outFileType.getFileTypeGUID() << std::endl;
+			ExplorationTree::get()->deleteItem(kidTreeItem);
+		} else {
+			itemData->setObjectChain(kidchain);
+			_kidChains.push_back(itemData);
+		}
+	}
+
+	//realize visible items:
+	//ExplorationTree::get()->realizeVisible(); done by the tree itself
+
+	//now realize those chains:
+	/*if (!realizeKidChains()) {
+		deleteKidChains();
+		errout << wxT("ERROR: DirectoryPresenter::expand(): can't realize kids.") << std::endl;
+		return; //TODO: report error
+	}*/
+}
+
+void DirectoryPresenter::deleteKidChains() {
+	std::list<VirtualNodeItemData*>::const_iterator i;
+	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
+		VirtualNodeItemData* data = *i;
+		ObjectChain* kidchain = data->getObjectChain();
+		ASSERT(kidchain);
+		delete kidchain; //unrealize
+	}
+	_kidChains.clear();
+
+	VirtualNode* node = _inodeprovider->getNode();
+	ExplorationTree::get()->deleteChildren(node->getTreeItem());
+}
+
+bool DirectoryPresenter::realizeKidChains() {
+	bool res = true;
+	/*std::list<ObjectChain*>::const_iterator i;
+	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
+		ObjectChain* kidchain = *i;
+		kidchain->complete();
+		res &= kidchain->realize();
+	}*/
+	return res;
+}
+
+void DirectoryPresenter::dumpObjectChains(streamout& os) {
+	std::list<VirtualNodeItemData*>::const_iterator i;
+	int idx = 0;
+	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
+		VirtualNodeItemData* data = *i;
+		ObjectChain* kidchain = data->getObjectChain();
+		ASSERT(kidchain);
+		kidchain->dumpObjectChain(coreString(wxT("kid")) + toString(idx), os);
+		idx++;
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+}

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.h (from rev 28029, scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryPresenter.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DirectoryPresenter.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+// DirectoryPresenter.h
+
+#ifndef _DIRECTORY_PRESENTER_H_
+#define _DIRECTORY_PRESENTER_H_
+
+#include "pinslot.h"
+#include "ochain.h"
+#include "CoreInterfaces.h"
+#include "VirtualNode.h"
+#include "FileTypeRecognizer.h"
+#include "DirectoryController.h"
+
+#include <list>
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class INodeProvider;
+
+class DirectoryPresenter : public BObject, public DirectoryController {
+	DECLARE_BOBJECT_CLASS(DirectoryPresenter, BObject)
+
+protected:
+	Slot<IDirectory>* _directorySlot;
+	Slot<INodeProvider>* _nodeSlot;
+
+	IDirectory* _idirectory;
+	INodeProvider* _inodeprovider;
+	std::list<VirtualNodeItemData*> _kidChains;
+
+	bool _expanded;
+
+public:
+	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
+
+	SLOTS_DECL
+
+	DirectoryPresenter()
+	: _idirectory(NULL), _inodeprovider(NULL), _expanded(false) {}
+
+	virtual bool doRealize(ObjectChain* ochain);
+	virtual void doUnrealize(ObjectChain* ochain);
+
+	virtual bool realizeKidChains();
+	virtual void deleteKidChains();
+
+	virtual void expand();
+	ObjectChain* prepareKidChain(const RCPtr<VirtualNode>& virtualNode, guid_list& parsers);
+
+	virtual void dumpObjectChains(streamout& os);
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+}
+
+#endif //_DIRECTORY_PRESENTER_H_

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp (from rev 28029, scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,42 @@
+/////////////////////////////////////////////////////////////////////////////
+// DiskFileProvider.cpp
+
+#include "plugins_stdafx.h"
+
+#include "DiskFileProvider.h"
+#include "common/simplefile.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(DiskFileProvider)
+	PIN_DESC(_filePin, PIN_MULTICAST, getFileImpl, releaseFileImpl)
+END_DESCS
+
+
+IStreamFileImpl* DiskFileProvider::getFileImpl() {
+	//infoout << wxT("DiskFileProvider::getFileImpl(): ") << _diskFileName << std::endl;
+	Common::SimpleFile* file = new Common::SimpleFile();
+	bool res = file->open(_diskFileName);
+	if (!res) {
+		delete file;
+		return NULL;
+	}
+	return new IStreamFileImpl(NULL, _diskFileName, file, true);
+}
+
+void DiskFileProvider::releaseFileImpl(IStreamFileImpl* iface) {
+	//infoout << wxT("DiskFileProvider::releaseFileImpl(): ") << _diskFileName << std::endl;
+	delete iface;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h (from rev 28029, scummex/branches/gsoc2007-gameresbrowser/src/browser/DiskFileProvider.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h	2007-07-11 14:07:33 UTC (rev 28030)
@@ -0,0 +1,49 @@
+/////////////////////////////////////////////////////////////////////////////
+// DiskFileProvider.h
+
+// This class in unused, although potentially usable.
+
+#ifndef _DISKFILEPROVIDER_H_
+#define _DISKFILEPROVIDER_H_
+
+#include "pinslot.h"
+
+#include "CoreInterfaces.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class DiskFileProvider : public BObject {
+	DECLARE_BOBJECT_CLASS(DiskFileProvider, BObject)
+
+protected:
+	Pin<IFile>* _filePin;
+
+	coreString _diskFileName;
+
+public:
+	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
+
+	PINS_DECL
+
+	DiskFileProvider() {}
+	DiskFileProvider(coreString diskFileName)
+		: _diskFileName(diskFileName) {}
+
+	virtual void init(coreString diskFileName) {
+		_diskFileName = diskFileName;
+	}
+
+	IStreamFileImpl* getFileImpl();
+	void releaseFileImpl(IStreamFileImpl* iface);
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser
+
+#endif // _DISKFILEPROVIDER_H_


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