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

zbychs at users.sourceforge.net zbychs at users.sourceforge.net
Mon Jul 9 14:17:15 CEST 2007


Revision: 27990
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27990&view=rev
Author:   zbychs
Date:     2007-07-09 05:17:15 -0700 (Mon, 09 Jul 2007)

Log Message:
-----------
Improved loading times by making DirectoryPresenter more lazy.
Added additional presenters. Scumm support sill in the brewing.

Modified Paths:
--------------
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt
    scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.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/FileInfoPresenter.cpp
    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/MainFormCommands.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.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/gui/VirtualNode.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/VirtualNode.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.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/resource.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.h
    scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj
    scummex/branches/gsoc2007-gameresbrowser/vc8/vc8.sln
    scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout

Added Paths:
-----------
    scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.h

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -37,6 +37,10 @@
 
 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) )
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreFileTypes.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -36,6 +36,10 @@
 
 SAFE_STATIC_DECL(fileInfoPresenterGUID, BGUID)
 
+SAFE_STATIC_DECL(textParserGUID, BGUID)
+SAFE_STATIC_DECL(binaryParserGUID, BGUID)
+SAFE_STATIC_DECL(bmpParserGUID, BGUID)
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreInterfaces.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -205,6 +205,7 @@
 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() {
@@ -215,10 +216,17 @@
 class ITextImpl : public IText {
 	wxString _title;
 	wxString _text;
+	bool _monospace;
 public:
-	ITextImpl(const wxString& title, const wxString& text)
-		: _title(title), _text(text) {}
+	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;
 	}
@@ -230,6 +238,42 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+//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_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ReadMe.txt	2007-07-09 12:17:15 UTC (rev 27990)
@@ -5,6 +5,9 @@
 Library with core objects for the Game Resource Browser.
 
 TODO: When doing IFile/IStream->getStream() check for NULL result!
+TODO: More lazy DirectoryPresenter
+TODO: PanelProvider panelActivated - run it only when really *activated*, and not
+      when created (some rebuild of the interface needed).
 
 Guidelines:
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -24,12 +24,24 @@
 	#define streamout std::wostream
 	#define strstreamout std::wostringstream
 	#define fstreamout std::wfstream
+	#ifndef stprintf
+	#define stprintf swprintf
+	#endif
+	#ifndef tstrcat
+	#define tstrcat wcscat
+	#endif
 #else
 	#define errout std::cerr
 	#define infoout std::cout
 	#define streamout std::ostream
 	#define strstreamout std::ostringstream
 	#define fstreamout std::fstream
+	#ifndef stprintf
+	#define stprintf sprintf
+	#endif
+	#ifndef tstrcat
+	#define tstrcat strcat
+	#endif
 #endif
 
 #define coreString wxString

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -42,6 +42,16 @@
 	return objects.count(obj) == 1;
 }
 
+bool ObjectChain::isContained(const BGUID& objGUID) {
+	object_set::iterator i;
+	for (i = objects.begin(); i != objects.end(); ++i) {
+		const BGUID& guid = (*i)->get_GUID();
+		if (guid == objGUID)
+			return true;
+	}
+	return false;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -54,6 +54,7 @@
 	bool addObject(const RCPtr<BObject>& obj);
 
 	bool isContained(const RCPtr<BObject>& obj);
+	bool isContained(const BGUID& objGUID);
 
 	void complete();
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -61,6 +61,16 @@
 	return wxString(wxConvCurrent->cMB2WX(str));
 }
 
+inline
+wxString toString(const wchar_t * str) {
+	return wxString(wxConvCurrent->cWC2WX(str));
+}
+
+inline
+wxString toString(wchar_t * str) {
+	return wxString(wxConvCurrent->cWC2WX(str));
+}
+
 template<int N>
 inline
 wxString toString(const char str[N]) {
@@ -73,6 +83,18 @@
 	return wxString(wxConvCurrent->cMB2WX(str));
 }
 
+template<int N>
+inline
+wxString toString(const wchar_t str[N]) {
+	return wxString(wxConvCurrent->cWC2WX(str));
+}
+
+template<int N>
+inline
+wxString toString(wchar_t str[N]) {
+	return wxString(wxConvCurrent->cWC2WX(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-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -38,8 +38,9 @@
 	ExplorationTree::get()->registerDirectoryPresenter(node, this);
 	//ExplorationTree::get()->setItemHasChildren(node, true);
 
-	wxTreeItemId dummyTreeItem = ExplorationTree::get()->appendItem(
-		node->getTreeItem(), wxT("Dummy"));
+	//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
+	//wxTreeItemId dummyTreeItem = ExplorationTree::get()->appendItem(
+	//	node->getTreeItem(), wxT("Dummy"));
 
 	_expanded = false;
 
@@ -104,6 +105,9 @@
 		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;
@@ -112,8 +116,6 @@
 
 	infoout << wxT("DirectoryPresenter::expand(): ") << _idirectory->getName().c_str() << std::endl;
 
-	VirtualNode* parent = _inodeprovider->getNode();
-
 	const std::list<IDirectory*>& subdirs = _idirectory->getSubDirs();
 	std::list<IDirectory*>::const_iterator j;
 	for (j = subdirs.begin(); j != subdirs.end(); ++j) {
@@ -124,7 +126,8 @@
 
 		RCPtr<VirtualNode> virtualDir( new VirtualDirectory(kidTreeItem, idirectory) );
 
-		ExplorationTree::get()->setItemData(kidTreeItem, new VirtualNodeItemData( virtualDir.get() ) );
+		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualDir.get(), NULL, false);
+		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
 
 		guid_list parsers;
 		//could omit it - ObjectChain::complete() would find it
@@ -136,19 +139,8 @@
 				<< idirectory->getName() << std::endl;
 			ExplorationTree::get()->deleteItem(kidTreeItem);
 		} else {
-			kidchain->complete();
-			bool res = kidchain->realize();
-			if (!res) {
-				errout << wxT("ERROR: DirectoryPresenter::expand(): can't realize chain for dir: ")
-					<< idirectory->getName() << std::endl;
-				wxString outName = idirectory->getName() + wxT(".dot");
-				errout << wxT("Dumping Object Chain to: ") << outName << std::endl;
-				kidchain->dumpObjectChain(outName);
-				delete kidchain;
-				ExplorationTree::get()->deleteItem(kidTreeItem);
-			} else {
-				_kidChains.push_back(kidchain);
-			}
+			itemData->setObjectChain(kidchain);
+			_kidChains.push_back(itemData);
 		}
 	}
 
@@ -167,14 +159,19 @@
 		VirtualFile* virtualFile = new VirtualFile(kidTreeItem, ifile);
 		RCPtr<VirtualNode> virtualNode(virtualFile);
 
-		ExplorationTree::get()->setItemData(kidTreeItem, new VirtualNodeItemData(virtualFile) );
+		VirtualNodeItemData* itemData = new VirtualNodeItemData(virtualFile, NULL, false);
+		ExplorationTree::get()->setItemData(kidTreeItem, itemData);
 
 		//Here we try to figure the fileType and the best parsers for it:
 
-		RecognizedFileType outFileType(RecognizedFileType::NotRecognized());
+		RecognizedFileType outFileType(ifile->getFileType());
 		guid_list parsers;
-		parsers = FileTypeRegistry::get()->resolveParsers(virtualFile, outFileType);
-		ifile->setFileType(outFileType);
+		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:
 
@@ -184,22 +181,14 @@
 				<< ifile->getName() << wxT(" file type: ") << outFileType.getFileTypeGUID() << std::endl;
 			ExplorationTree::get()->deleteItem(kidTreeItem);
 		} else {
-			kidchain->complete();
-			bool res = kidchain->realize();
-			if (!res) {
-				errout << wxT("ERROR: DirectoryPresenter::expand(): can't realize chain for file: ")
-					<< ifile->getName() << wxT(" file type: ") << outFileType.getFileTypeGUID() << std::endl;
-				wxString outName = ifile->getName() + wxT(".dot");
-				errout << wxT("Dumping Object Chain to: ") << outName << std::endl;
-				kidchain->dumpObjectChain(outName);
-				delete kidchain;
-				ExplorationTree::get()->deleteItem(kidTreeItem);
-			} else {
-				_kidChains.push_back(kidchain);
-			}
+			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();
@@ -209,9 +198,11 @@
 }
 
 void DirectoryPresenter::deleteKidChains() {
-	std::list<ObjectChain*>::const_iterator i;
+	std::list<VirtualNodeItemData*>::const_iterator i;
 	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
-		ObjectChain* kidchain = *i;
+		VirtualNodeItemData* data = *i;
+		ObjectChain* kidchain = data->getObjectChain();
+		ASSERT(kidchain);
 		delete kidchain; //unrealize
 	}
 	_kidChains.clear();
@@ -232,10 +223,12 @@
 }
 
 void DirectoryPresenter::dumpObjectChains(streamout& os) {
-	std::list<ObjectChain*>::const_iterator i;
+	std::list<VirtualNodeItemData*>::const_iterator i;
 	int idx = 0;
 	for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
-		ObjectChain* kidchain = *i;
+		VirtualNodeItemData* data = *i;
+		ObjectChain* kidchain = data->getObjectChain();
+		ASSERT(kidchain);
 		kidchain->dumpObjectChain(coreString(wxT("kid")) + toString(idx), os);
 		idx++;
 	}

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -28,7 +28,7 @@
 
 	IDirectory* _idirectory;
 	INodeProvider* _inodeprovider;
-	std::list<ObjectChain*> _kidChains;
+	std::list<VirtualNodeItemData*> _kidChains;
 
 	bool _expanded;
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -9,6 +9,8 @@
 
 #include "ochain.h"
 
+#include <iostream>
+
 #include <map>
 #include <list>
 
@@ -176,17 +178,75 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-/*static*/ /*wxTreeCtrl* ExplorationTree::_getTree() {
-	return get()->getTree();
+void ExplorationTree::realizeVisible(bool dirsOnly /*= true*/) {
+	wxTreeItemId item = _explorationTree->GetFirstVisibleItem();
+	while (item.IsOk() &&
+		_explorationTree->IsVisible(item)) {  //WORKAROUND: in wxMSW this is necessary
+		realizeNode(item, dirsOnly);
+		item = _explorationTree->GetNextVisible(item);
+	}
 }
 
-wxTreeCtrl* ExplorationTree::getTree() {
-	return _explorationTree;
-}*/
+bool ExplorationTree::realizeNode(const wxTreeItemId& item, bool dirsOnly /*= false*/) {
+	ASSERT_VALID_TREE_ITEM(item);
+	VirtualNodeItemData* data = VirtualNodeItemData::getForNode(item);
+	if (!data)
+		return false;
 
+	if (!data->getRealized()) {
+		ObjectChain* kidchain = data->getObjectChain();
+		ASSERT(kidchain);
+
+		kidchain->complete();
+
+		if (dirsOnly) {
+			if (!kidchain->isContained(DirectoryPresenter::static_GUID()))
+				return true;
+			//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
+			wxTreeItemId dummyTreeItem = ExplorationTree::get()->appendItem(
+				item, wxT("Dummy"));
+			return true;
+		}
+
+		wxString name = getItemText(item);
+		infoout << wxT("ExplorationTree::realizeNode(): realizing chain for node: ")
+			<< name << std::endl;
+
+		bool res = kidchain->realize();
+
+		if (!res) {
+			errout << wxT("ERROR: ExplorationTree::realizeNode(): can't realize chain for node: ")
+				<< name << std::endl;
+			wxString outName = name + wxT(".dot");
+			errout << wxT("Dumping Object Chain to: ") << outName << std::endl;
+			kidchain->dumpObjectChain(outName);
+
+			//delete kidchain;
+			//deleteItem(item);
+
+			return false;
+		} else {
+			data->setRealized(true);
+		}
+	}
+
+	return true;
+}
+
+VirtualNode* ExplorationTree::getNode(const wxTreeItemId& item) {
+	if (!realizeNode(item))
+		return NULL;
+
+	VirtualNodeItemData* data = VirtualNodeItemData::getForNode(item);
+	if (!data)
+		return NULL;
+
+	return data->getNode();
+}
+
 VirtualNode* ExplorationTree::getSelectedNode() {
 	wxTreeItemId item = getSelected();
-	VirtualNode* node = VirtualNodeItemData::getNode(item);
+	VirtualNode* node = getNode(item);
 	return node;
 }
 
@@ -199,6 +259,7 @@
 	ASSERT_VALID_TREE_ITEM(parent);
 	wxTreeItemId item = _explorationTree->AppendItem(parent, title, -1, -1, NULL);
 	ASSERT_VALID_TREE_ITEM(item);
+	//_explorationTree->SetItemHasChildren(item);
 	return item;
 }
 
@@ -334,7 +395,7 @@
 }
 
 void ExplorationTree::itemActivated(wxTreeItemId item) {
-	VirtualNode* node = VirtualNodeItemData::getNode(item);
+	VirtualNode* node = getNode(item);
 	if (node)
 		nodeActivated(node);
 }
@@ -361,12 +422,19 @@
 	dirExpanded(dirPresenter);
 }
 
-void ExplorationTree::itemExpanded(wxTreeItemId item) {
-	VirtualNode* node = VirtualNodeItemData::getNode(item);
+void ExplorationTree::itemExpanding(wxTreeItemId item) {
+	VirtualNode* node = getNode(item);
 	if (node)
 		nodeExpanded(node);
 }
 
+void ExplorationTree::itemExpanded(wxTreeItemId item) {
+	VirtualNode* node = getNode(item);
+	if (node) {
+		realizeVisible();
+	}
+}
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -53,7 +53,11 @@
 
 	//static wxTreeCtrl* _getTree();
 	//wxTreeCtrl* getTree();
+	void realizeVisible(bool dirsOnly = true);
+	bool realizeNode(const wxTreeItemId& item, bool dirsOnly = false);
+	VirtualNode* getNode(const wxTreeItemId& item);
 	VirtualNode* getSelectedNode();
+
 	wxTreeItemId getSelected();
 	wxTreeItemId appendItem(const wxTreeItemId& parent, wxString title);
 	void _recDel(const wxTreeItemId& item, bool thisToo); //HACK
@@ -78,6 +82,7 @@
 	void nodeExpanded(VirtualNode* expandedNode);
 
 	void itemActivated(wxTreeItemId item);
+	void itemExpanding(wxTreeItemId item);
 	void itemExpanded(wxTreeItemId item);
 
 	void registerPanelProvider(VirtualNode* node, PanelProvider* panelProvider);

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FileInfoPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -42,27 +42,18 @@
 
 	wxString text = getInfo();
 
-	wxButton *dumpButton;
-	wxTextCtrl *textCtrl;
-	wxBoxSizer *WxBoxSizer1;
+	wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
 
-	WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
-	panel->SetSizer(WxBoxSizer1);
+	wxTextCtrl *textCtrl = new wxTextCtrl(panel, wxID_ANY, text, wxPoint(5,5), wxSize(200,200), wxTE_READONLY | wxTE_RICH | wxTE_MULTILINE, wxDefaultValidator, wxT("textCtrl"));
+	panelsizer->Add(textCtrl,	1, wxALL|wxEXPAND, 0);
+	wxButton *dumpButton = new wxButton(panel, wxID_ANY, wxT("Dump File"), wxPoint(167,450), wxSize(75,25), 0, wxDefaultValidator, wxT("dumpButton"));
+	panelsizer->Add(dumpButton,	0, wxALL, 0);
+
 	panel->SetAutoLayout(true);
+	panel->SetSizer(panelsizer);	
 
-	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);
+	panel->Layout();
 
-	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);
 }

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -0,0 +1,95 @@
+/////////////////////////////////////////////////////////////////////////////
+// TextPresenter.cpp
+
+#include "gui_stdafx.h"
+
+#include "HtmlPresenter.h"
+
+#include "CoreInterfaces.h"
+
+#include <wx/html/htmlwin.h>
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(HtmlPresenter)
+	PIN_DESC_r(_panelRecieverPin, PIN_DEFAULT, getPanelRecieverImpl, IPanelRecieverImpl)
+END_DESCS
+
+SLOT_DESCS_EX(HtmlPresenter)
+	SLOT_DESC(_urlSlot, SLOT_DEFAULT)
+END_DESCS
+
+bool HtmlPresenter::doRealize(ObjectChain* ochain) {
+	bool res = BObject::doRealize(ochain);
+	if (!res)
+		return false;
+
+	return true;
+}
+
+void HtmlPresenter::doUnrealize(ObjectChain* ochain) {
+	_iurl = NULL;
+	_urlSlot->releaseInterface();
+
+	BObject::doUnrealize(ochain);
+}
+
+IPanelRecieverImpl* HtmlPresenter::getPanelRecieverImpl() {
+	//infoout << wxT("HtmlPresenter::getPanelRecieverImpl(): ") << std::endl;
+	return new IPanelRecieverImpl(this);
+}
+
+
+coreString HtmlPresenter::getPanelTitle() {
+	_iurl = _urlSlot->getInterface();
+	if (!_iurl) {
+		errout << wxT("HtmlPresenter::getPanelTitle(): could not get IText interface") << std::endl;
+		return wxT("ERROR");
+	}
+
+	return _iurl->getTitle();
+}
+
+void HtmlPresenter::panelActivate(wxPanel* panel) {
+	//infoout << wxT("HtmlPresenter::panelActivate()") << std::endl;
+
+	_iurl = _urlSlot->getInterface();
+	if (!_iurl) {
+		errout << wxT("HtmlPresenter::panelActivate(): could not get IText interface") << std::endl;
+		return;
+	}
+
+	if (_iurl->isEmpty())
+		return;
+	const wxString& url = _iurl->getUrl();
+	if (url.IsEmpty())
+		return;
+
+	wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
+
+	wxHtmlWindow *htmlWindow = new wxHtmlWindow(panel, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO, wxT("htmlWindow"));
+	panelsizer->Add(htmlWindow,	1, wxALL|wxEXPAND, 0);
+
+	panel->SetAutoLayout(true);
+	panel->SetSizer(panelsizer);	
+
+	panel->Layout();
+
+	htmlWindow->LoadPage(url);
+}
+
+void HtmlPresenter::panelDeactivate() {
+	//infoout << wxT("HtmlPresenter::panelDeactivate()") << std::endl;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace Browser


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

Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/HtmlPresenter.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// HtmlPresenter.h
+
+#ifndef _HTML_PRESENTER_H_
+#define _HTML_PRESENTER_H_
+
+#include <wx/wx.h>
+
+#include "PanelProvider.h"
+#include "CoreInterfaces.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class HtmlPresenter : public BObject, public PanelReciever {
+	DECLARE_BOBJECT_CLASS(HtmlPresenter, BObject)
+
+protected:
+	Slot<IUrl>* _urlSlot;
+	Pin<IPanelReciever>* _panelRecieverPin;
+
+	IUrl* _iurl;
+
+public:
+	ASSIGN_DESC(0, wxT("CoreObjects"), 1)
+
+	PINS_DECL
+	SLOTS_DECL
+
+	HtmlPresenter()
+	: _iurl(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 //_HTML_PRESENTER_H_


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

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -41,6 +41,7 @@
 	////Manual Code End
 	
 	EVT_CLOSE(MainForm::OnClose)
+	EVT_MENU(ID_OPEN, MainForm::OnOpen)
 	EVT_MENU(wxID_EXIT, MainForm::OnExit)
 	EVT_MENU(ID_DUMPROOTOBJECTCHAIN, MainForm::OnDumpRootObjectChain)
 	EVT_MENU(ID_DUMPCURRENTOBJECTCHAIN, MainForm::OnDumpCurrentObjectChain)
@@ -51,6 +52,7 @@
 	EVT_MENU(ID_TEST2, MainForm::OnTest2)
 	
 	EVT_TREE_ITEM_ACTIVATED(ID_BROWSERTREE,MainForm::browserTreeItemActivated)
+	EVT_TREE_ITEM_EXPANDED(ID_BROWSERTREE,MainForm::browserTreeItemExpanded)
 	EVT_TREE_ITEM_EXPANDING(ID_BROWSERTREE,MainForm::browserTreeItemExpanding)
 END_EVENT_TABLE()
 ////Event Table End
@@ -123,7 +125,6 @@
 	WxMenuBar1 = new wxMenuBar();
 	wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
 	ID_FILE_MENU_Mnu_Obj->Append(ID_OPEN, wxT("Open..."), wxT(""), wxITEM_NORMAL);
-	ID_FILE_MENU_Mnu_Obj->Enable(ID_OPEN,false);
 	ID_FILE_MENU_Mnu_Obj->AppendSeparator();
 	ID_FILE_MENU_Mnu_Obj->Append(wxID_EXIT, wxT("Exit"), wxT(""), wxITEM_NORMAL);
 	WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("File"));
@@ -142,6 +143,8 @@
 	WxMenuBar1->Append(ID_TEST_MENU_Mnu_Obj, wxT("Tests"));
 	SetMenuBar(WxMenuBar1);
 
+	WxOpenFileDialog1 =  new wxFileDialog(this, wxT("Choose a file"), wxT(""), wxT(""), wxT("*.*"), wxOPEN);
+
 	WxSplitterWindow1->SplitVertically(browserTree,mainPanel,329);
 
 	SetTitle(wxT("Game Resource Browser"));

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -18,6 +18,7 @@
 //Header Include Start and Header Include End.
 //wxDev-C++ designer will remove them. Add custom headers after the block.
 ////Header Include Start
+#include <wx/filedlg.h>
 #include <wx/menu.h>
 #include <wx/notebook.h>
 #include <wx/panel.h>
@@ -56,12 +57,15 @@
 	void OnTest2(wxCommandEvent& event);
 	void OnDumpCurrentObjectChain(wxCommandEvent& event);
 	void OnActivateNode(wxCommandEvent& event);
+		void browserTreeItemExpanded(wxTreeEvent& event);
+	void OnOpen(wxCommandEvent& event);
 		
 	private:
 		//Do not add custom control declarations between
 		//GUI Control Declaration Start and GUI Control Declaration End.
 		//wxDev-C++ will remove them. Add custom code after the block.
 		////GUI Control Declaration Start
+		wxFileDialog *WxOpenFileDialog1;
 		wxMenuBar *WxMenuBar1;
 		wxNotebook *browserNotebook;
 		wxBoxSizer *WxBoxSizer2;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform	2007-07-09 12:17:15 UTC (rev 27990)
@@ -71,6 +71,7 @@
         Indent = 19
         TabOrder = 0
         EVT_TREE_ITEM_ACTIVATED = 'browserTreeItemActivated'
+        EVT_TREE_ITEM_EXPANDED = 'browserTreeItemExpanded'
         EVT_TREE_ITEM_EXPANDING = 'browserTreeItemExpanding'
         Wx_BGColor = clBlack
         Wx_Class = 'wxTreeCtrl'
@@ -238,140 +239,227 @@
       060446696C6512436172726965642E57785F436865636B656408164361727269
       65642E57585F4249544D41502E446174610A0C00000007544269746D61700000
       000016436172726965642E57785F46696C65486973746F727908184361727269
-      65642E5778437573746F6D4D656E754974656D0AC90300001100000054577843
+      65642E5778437573746F6D4D656E754974656D0AE20300001100000054577843
       7573746F6D4D656E754974656D5450463018547778437573746F6D4D656E7549
-      74656D577261707065720011436172726965642E49735375624D656E75081243
-      6172726965642E57785F456E61626C65640811436172726965642E57785F4869
-      6464656E0811436172726965642E57785F49444E616D65060749445F4F50454E
-      12436172726965642E57785F494456616C756503ED0318436172726965642E57
-      785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C
-      12436172726965642E57785F43617074696F6E06074F70656E2E2E2E12436172
-      726965642E57785F436865636B65640816436172726965642E57585F4249544D
-      41502E446174610A0C00000007544269746D6170000000001643617272696564
-      2E57785F46696C65486973746F727908000011000000545778437573746F6D4D
-      656E754974656D5450463018547778437573746F6D4D656E754974656D577261
-      707065720011436172726965642E49735375624D656E75081243617272696564
-      2E57785F456E61626C65640911436172726965642E57785F48696464656E0811
-      436172726965642E57785F49444E616D65060B777849445F5354415449431243
-      6172726965642E57785F494456616C756503EF0318436172726965642E57785F
-      4D656E754974656D5374796C65071277784D6E7549746D5F536570617261746F
-      7212436172726965642E57785F43617074696F6E06032D2D2D12436172726965
-      642E57785F436865636B65640816436172726965642E57585F4249544D41502E
-      446174610A0C00000007544269746D61700000000016436172726965642E5778
-      5F46696C65486973746F727908000011000000545778437573746F6D4D656E75
-      4974656D5450463018547778437573746F6D4D656E754974656D577261707065
-      720011436172726965642E49735375624D656E750810436172726965642E4556
-      545F4D656E7506064F6E4578697412436172726965642E57785F456E61626C65
-      640911436172726965642E57785F48696464656E0811436172726965642E5778
-      5F49444E616D650609777849445F4558495412436172726965642E57785F4944
-      56616C756503F10318436172726965642E57785F4D656E754974656D5374796C
-      65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F4361
-      7074696F6E06044578697412436172726965642E57785F436865636B65640816
-      436172726965642E57585F4249544D41502E446174610A0C0000000754426974
-      6D61700000000016436172726965642E57785F46696C65486973746F72790800
-      00000011000000545778437573746F6D4D656E754974656D5450463018547778
-      437573746F6D4D656E754974656D577261707065720011436172726965642E49
-      735375624D656E750812436172726965642E57785F456E61626C656409114361
-      72726965642E57785F48696464656E0811436172726965642E57785F49444E61
-      6D65061049445F434F4D4D414E44535F4D454E5512436172726965642E57785F
-      494456616C756503010418436172726965642E57785F4D656E754974656D5374
-      796C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F
-      43617074696F6E0608436F6D6D616E647312436172726965642E57785F436865
-      636B65640816436172726965642E57585F4249544D41502E446174610A0C0000
-      0007544269746D61700000000016436172726965642E57785F46696C65486973
-      746F72790818436172726965642E5778437573746F6D4D656E754974656D0A72
-      04000011000000545778437573746F6D4D656E754974656D5450463018547778
-      437573746F6D4D656E754974656D577261707065720011436172726965642E49
-      735375624D656E750810436172726965642E4556545F4D656E7506154F6E4475
-      6D70526F6F744F626A656374436861696E12436172726965642E57785F456E61
+      74656D577261707065720011436172726965642E49735375624D656E75081043
+      6172726965642E4556545F4D656E7506064F6E4F70656E12436172726965642E
+      57785F456E61626C65640911436172726965642E57785F48696464656E081143
+      6172726965642E57785F49444E616D65060749445F4F50454E12436172726965
+      642E57785F494456616C756503ED0318436172726965642E57785F4D656E7549
+      74656D5374796C65070F77784D6E7549746D5F4E6F726D616C12436172726965
+      642E57785F43617074696F6E06074F70656E2E2E2E12436172726965642E5778
+      5F436865636B65640816436172726965642E57585F4249544D41502E44617461
+      0A0C00000007544269746D61700000000016436172726965642E57785F46696C
+      65486973746F727908000011000000545778437573746F6D4D656E754974656D
+      5450463018547778437573746F6D4D656E754974656D57726170706572001143
+      6172726965642E49735375624D656E750812436172726965642E57785F456E61
       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
-      746F6D4D656E754974656D0A9D05000011000000545778437573746F6D4D656E
-      754974656D5450463018547778437573746F6D4D656E754974656D5772617070
-      65720011436172726965642E49735375624D656E750810436172726965642E45
-      56545F4D656E7506074F6E546573743112436172726965642E57785F456E6162
-      6C65640911436172726965642E57785F48696464656E0811436172726965642E
-      57785F49444E616D65060849445F544553543112436172726965642E57785F49
-      4456616C756503F30318436172726965642E57785F4D656E754974656D537479
-      6C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F43
-      617074696F6E06185465737431202D204E6F205363756D6D20506C7567696E73
-      12436172726965642E57785F436865636B65640816436172726965642E57585F
-      4249544D41502E446174610A0C00000007544269746D61700000000016436172
-      726965642E57785F46696C65486973746F727908000011000000545778437573
-      746F6D4D656E754974656D5450463018547778437573746F6D4D656E75497465
-      6D577261707065720011436172726965642E49735375624D656E750810436172
-      726965642E4556545F4D656E75060E4F6E5465737431436C65616E7570124361
-      72726965642E57785F456E61626C65640911436172726965642E57785F486964
-      64656E0811436172726965642E57785F49444E616D65061049445F5445535431
-      5F434C45414E555012436172726965642E57785F494456616C756503F4031843
-      6172726965642E57785F4D656E754974656D5374796C65070F77784D6E754974
-      6D5F4E6F726D616C12436172726965642E57785F43617074696F6E060C546573
-      7420436C65616E757012436172726965642E57785F436865636B656408164361
-      72726965642E57585F4249544D41502E446174610A0C00000007544269746D61
-      700000000016436172726965642E57785F46696C65486973746F727908000011
-      000000545778437573746F6D4D656E754974656D545046301854777843757374
-      6F6D4D656E754974656D577261707065720011436172726965642E4973537562
-      4D656E750810436172726965642E4556545F4D656E7506074F6E546573743012
-      436172726965642E57785F456E61626C65640911436172726965642E57785F48
-      696464656E0811436172726965642E57785F49444E616D65060849445F544553
-      543012436172726965642E57785F494456616C756503FE031843617272696564
-      2E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D
-      616C12436172726965642E57785F43617074696F6E06185465737430202D204E
-      6F205363756D6D20506C7567696E7312436172726965642E57785F436865636B
+      2E57785F49444E616D65060B777849445F53544154494312436172726965642E
+      57785F494456616C756503EF0318436172726965642E57785F4D656E75497465
+      6D5374796C65071277784D6E7549746D5F536570617261746F72124361727269
+      65642E57785F43617074696F6E06032D2D2D12436172726965642E57785F4368
+      65636B65640816436172726965642E57585F4249544D41502E446174610A0C00
+      000007544269746D61700000000016436172726965642E57785F46696C654869
+      73746F727908000011000000545778437573746F6D4D656E754974656D545046
+      3018547778437573746F6D4D656E754974656D57726170706572001143617272
+      6965642E49735375624D656E750810436172726965642E4556545F4D656E7506
+      064F6E4578697412436172726965642E57785F456E61626C6564091143617272
+      6965642E57785F48696464656E0811436172726965642E57785F49444E616D65
+      0609777849445F4558495412436172726965642E57785F494456616C756503F1
+      0318436172726965642E57785F4D656E754974656D5374796C65070F77784D6E
+      7549746D5F4E6F726D616C12436172726965642E57785F43617074696F6E0604
+      4578697412436172726965642E57785F436865636B6564081643617272696564
+      2E57585F4249544D41502E446174610A0C00000007544269746D617000000000
+      16436172726965642E57785F46696C65486973746F7279080000000011000000
+      545778437573746F6D4D656E754974656D5450463018547778437573746F6D4D
+      656E754974656D577261707065720011436172726965642E49735375624D656E
+      750812436172726965642E57785F456E61626C65640911436172726965642E57
+      785F48696464656E0811436172726965642E57785F49444E616D65061049445F
+      434F4D4D414E44535F4D454E5512436172726965642E57785F494456616C7565
+      03010418436172726965642E57785F4D656E754974656D5374796C65070F7778
+      4D6E7549746D5F4E6F726D616C12436172726965642E57785F43617074696F6E
+      0608436F6D6D616E647312436172726965642E57785F436865636B6564081643
+      6172726965642E57585F4249544D41502E446174610A0C00000007544269746D
+      61700000000016436172726965642E57785F46696C65486973746F7279081843
+      6172726965642E5778437573746F6D4D656E754974656D0A7204000011000000
+      545778437573746F6D4D656E754974656D5450463018547778437573746F6D4D
+      656E754974656D577261707065720011436172726965642E49735375624D656E
+      750810436172726965642E4556545F4D656E7506154F6E44756D70526F6F744F
+      626A656374436861696E12436172726965642E57785F456E61626C6564091143
+      6172726965642E57785F48696464656E0811436172726965642E57785F49444E
+      616D65061649445F44554D50524F4F544F424A454354434841494E1243617272
+      6965642E57785F494456616C756503020418436172726965642E57785F4D656E
+      754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243617272
+      6965642E57785F43617074696F6E061644756D7020526F6F74204F626A656374
+      20436861696E12436172726965642E57785F436865636B656408164361727269
+      65642E57585F4249544D41502E446174610A0C00000007544269746D61700000
+      000016436172726965642E57785F46696C65486973746F727908000011000000
+      545778437573746F6D4D656E754974656D5450463018547778437573746F6D4D
+      656E754974656D577261707065720011436172726965642E49735375624D656E
+      750810436172726965642E4556545F4D656E7506184F6E44756D704375727265
+      6E744F626A656374436861696E12436172726965642E57785F456E61626C6564
+      0911436172726965642E57785F48696464656E0811436172726965642E57785F
+      49444E616D65061949445F44554D5043555252454E544F424A45435443484149
+      4E12436172726965642E57785F494456616C756503040418436172726965642E
+      57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D61
+      6C12436172726965642E57785F43617074696F6E061944756D70204375727265
+      6E74204F626A65637420436861696E12436172726965642E57785F436865636B
       65640816436172726965642E57585F4249544D41502E446174610A0C00000007
       544269746D61700000000016436172726965642E57785F46696C65486973746F
       727908000011000000545778437573746F6D4D656E754974656D545046301854
       7778437573746F6D4D656E754974656D57726170706572001143617272696564
-      2E49735375624D656E750810436172726965642E4556545F4D656E7506074F6E
-      546573743212436172726965642E57785F456E61626C65640911436172726965
-      642E57785F48696464656E0811436172726965642E57785F49444E616D650608
-      49445F544553543212436172726965642E57785F494456616C75650300041843
-      6172726965642E57785F4D656E754974656D5374796C65070F77784D6E754974
-      6D5F4E6F726D616C12436172726965642E57785F43617074696F6E061A546573
-      7432202D2057697468205363756D6D20506C7567696E7312436172726965642E
+      2E49735375624D656E750810436172726965642E4556545F4D656E75060E4F6E
+      41637469766174654E6F646512436172726965642E57785F456E61626C656409
+      11436172726965642E57785F48696464656E0811436172726965642E57785F49
+      444E616D65060F49445F41435449564154454E4F444512436172726965642E57
+      785F494456616C756503050418436172726965642E57785F4D656E754974656D
+      5374796C65070F77784D6E7549746D5F4E6F726D616C12436172726965642E57
+      785F43617074696F6E060D4163746976617465204E6F64651243617272696564
+      2E57785F436865636B65640816436172726965642E57585F4249544D41502E44
+      6174610A0C00000007544269746D61700000000016436172726965642E57785F
+      46696C65486973746F7279080000000011000000545778437573746F6D4D656E
+      754974656D5450463018547778437573746F6D4D656E754974656D5772617070
+      65720011436172726965642E49735375624D656E750812436172726965642E57
+      785F456E61626C65640911436172726965642E57785F48696464656E08114361
+      72726965642E57785F49444E616D65060C49445F544553545F4D454E55124361
+      72726965642E57785F494456616C756503F20318436172726965642E57785F4D
+      656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C124361
+      72726965642E57785F43617074696F6E0605546573747312436172726965642E
       57785F436865636B65640816436172726965642E57585F4249544D41502E4461
       74610A0C00000007544269746D61700000000016436172726965642E57785F46
-      696C65486973746F72790800000000}
+      696C65486973746F72790818436172726965642E5778437573746F6D4D656E75
+      4974656D0A9D05000011000000545778437573746F6D4D656E754974656D5450
+      463018547778437573746F6D4D656E754974656D577261707065720011436172
+      726965642E49735375624D656E750810436172726965642E4556545F4D656E75
+      06074F6E546573743112436172726965642E57785F456E61626C656409114361
+      72726965642E57785F48696464656E0811436172726965642E57785F49444E61
+      6D65060849445F544553543112436172726965642E57785F494456616C756503
+      F30318436172726965642E57785F4D656E754974656D5374796C65070F77784D
+      6E7549746D5F4E6F726D616C12436172726965642E57785F43617074696F6E06
+      185465737431202D204E6F205363756D6D20506C7567696E7312436172726965
+      642E57785F436865636B65640816436172726965642E57585F4249544D41502E
+      446174610A0C00000007544269746D61700000000016436172726965642E5778
+      5F46696C65486973746F727908000011000000545778437573746F6D4D656E75
+      4974656D5450463018547778437573746F6D4D656E754974656D577261707065
+      720011436172726965642E49735375624D656E750810436172726965642E4556
+      545F4D656E75060E4F6E5465737431436C65616E757012436172726965642E57
+      785F456E61626C65640911436172726965642E57785F48696464656E08114361
+      72726965642E57785F49444E616D65061049445F54455354315F434C45414E55
+      5012436172726965642E57785F494456616C756503F40318436172726965642E
+      57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D61
+      6C12436172726965642E57785F43617074696F6E060C5465737420436C65616E
+      757012436172726965642E57785F436865636B65640816436172726965642E57
+      585F4249544D41502E446174610A0C00000007544269746D6170000000001643
+      6172726965642E57785F46696C65486973746F72790800001100000054577843
+      7573746F6D4D656E754974656D5450463018547778437573746F6D4D656E7549
+      74656D577261707065720011436172726965642E49735375624D656E75081043
+      6172726965642E4556545F4D656E7506074F6E54657374301243617272696564
+      2E57785F456E61626C65640911436172726965642E57785F48696464656E0811
+      436172726965642E57785F49444E616D65060849445F54455354301243617272
+      6965642E57785F494456616C756503FE0318436172726965642E57785F4D656E
+      754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243617272
+      6965642E57785F43617074696F6E06185465737430202D204E6F205363756D6D
+      20506C7567696E7312436172726965642E57785F436865636B65640816436172
+      726965642E57585F4249544D41502E446174610A0C00000007544269746D6170
+      0000000016436172726965642E57785F46696C65486973746F72790800001100
+      0000545778437573746F6D4D656E754974656D5450463018547778437573746F
+      6D4D656E754974656D577261707065720011436172726965642E49735375624D
+      656E750810436172726965642E4556545F4D656E7506074F6E54657374321243
+      6172726965642E57785F456E61626C65640911436172726965642E57785F4869
+      6464656E0811436172726965642E57785F49444E616D65060849445F54455354
+      3212436172726965642E57785F494456616C756503000418436172726965642E
+      57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D61
+      6C12436172726965642E57785F43617074696F6E061A5465737432202D205769
+      7468205363756D6D20506C7567696E7312436172726965642E57785F43686563
+      6B65640816436172726965642E57585F4249544D41502E446174610A0C000000
+      07544269746D61700000000016436172726965642E57785F46696C6548697374
+      6F72790800000000}
     Wx_HasHistory = False
   end
+  object WxOpenFileDialog1: TWxOpenFileDialog
+    Left = 155
+    Top = 110
+    Width = 28
+    Height = 27
+    TabOrder = 2
+    Glyph.Data = {
+      36090000424D3609000000000000360000002800000018000000180000000100
+      2000000000000009000000000000000000000000000000000000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080008080
+      8000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000000000000000000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000000000000000000000FFFF00C0C0C00000FFFF00C0C0
+      C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF000000
+      0000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C0000000000000FFFF000000000000FFFF00C0C0C00000FF
+      FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF
+      FF0000000000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C00000000000FFFFFF0000000000C0C0C00000FFFF00C0C0
+      C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0
+      C00000000000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C0000000000000FFFF00FFFFFF0000000000C0C0C00000FF
+      FF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FFFF00C0C0C00000FF
+      FF00C0C0C00000000000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C00000000000FFFFFF0000FFFF00FFFFFF00000000000000
+      0000000000000000000000000000C0C0C00000FFFF00C0C0C00000FFFF00C0C0
+      C00000FFFF0000000000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C0000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF
+      FF00FFFFFF0000FFFF00FFFFFF00000000000000000000000000000000000000
+      000000000000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C00000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
+      FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000
+      0000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C0000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF
+      FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF000000
+      0000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C00000000000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
+      FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000
+      0000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C0000000000000FFFF00FFFFFF0000FFFF00FFFFFF0000FF
+      FF0000000000000000000000000000000000000000000000000000000000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000000000000000000000000000000000000000
+      0000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0
+      C000C0C0C000C0C0C000C0C0C000C0C0C0000000000000808000008080008080
+      8000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000808000008080008080
+      8000FFFFFF0000000000FF000000FF000000FF000000FF000000FF000000FF00
+      0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00
+      000000000000FFFFFF0000000000FFFFFF000000000000808000008080008080
+      8000808080008080800080808000808080008080800080808000808080008080
+      8000808080008080800080808000808080008080800080808000808080008080
+      8000808080008080800080808000808080008080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000008080000080
+      8000008080000080800000808000008080000080800000808000}
+    Wx_Class = 'wxFileDialog'
+    Wx_Message = 'Choose a file'
+    Wx_Extensions = '*.*'
+    Wx_DialogStyle = []
+  end
 end

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainFormCommands.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -38,6 +38,14 @@
  * browserTreeItemExpanding
  */
 void MainForm::browserTreeItemExpanding(wxTreeEvent& event) {
+	ExplorationTree::get()->itemExpanding(event.GetItem());
+}
+
+/*
+* browserTreeItemExpanded
+*/
+void MainForm::browserTreeItemExpanded(wxTreeEvent& event)
+{
 	ExplorationTree::get()->itemExpanded(event.GetItem());
 }
 
@@ -48,7 +56,7 @@
 	ASSERT(ochain);
 
 	wxFileDialog *saveDlg;
-	saveDlg = new wxFileDialog(NULL, wxT("Choose a file"), wxT(""), wxT("ochain.dot"), wxT("*.dot"), wxSAVE | wxOVERWRITE_PROMPT);
+	saveDlg = new wxFileDialog(this, wxT("Choose a file"), wxT(""), wxT("ochain.dot"), wxT("*.dot"), wxSAVE | wxOVERWRITE_PROMPT);
 	int res = saveDlg->ShowModal();
 
 	if (res == wxID_OK) {

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -67,8 +67,11 @@
 
 	RCPtr<RootDirectory> rootDir( new RootDirectory(rootItem) );
 
-	ExplorationTree::get()->setItemData(rootItem, new VirtualNodeItemData( rootDir.get() ) );
+	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	VirtualNodeItemData* itemData = new VirtualNodeItemData(rootDir.get(), rootChain, false);
+	ExplorationTree::get()->setItemData(rootItem, itemData);
 
+	rootChain->addObject(rootDir);
 
 	wxFileName doll(wxT("data"), wxT("lalka.bmp"));
 	wxFileName dog(wxT("data"), wxT("pies.bmp"));
@@ -83,22 +86,7 @@
 	if (foxes.IsOk() && foxes.FileExists() && foxes.IsFileReadable())
 		rootDir->addFile(wxT("Foxes"), toString(foxes.GetFullPath()));
 
-
-	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
-	rootChain->addObject(rootDir);
-
-	//RCPtr<BMPParser> bmp(new BMPParser());
-	//RCPtr<ImagePresenter> pres(new ImagePresenter( MainPanel::get() ));
-	//rootChain->addObject(pres);
-
-	rootChain->complete();
-
-	bool res = rootChain->realize();
-
-	if (!res) {
-		wxMessageBox(wxT("ObjectChain realisation failed."), wxT("Test0 Failed"),
-			wxOK | wxICON_ERROR, this);
-	}
+	ExplorationTree::get()->realizeVisible();
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -115,9 +103,13 @@
 
 	RCPtr<RootDirectory> rootDir( new RootDirectory(rootItem) );
 
-	ExplorationTree::get()->setItemData(rootItem, new VirtualNodeItemData( rootDir.get() ) );
+	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	VirtualNodeItemData* itemData = new VirtualNodeItemData(rootDir.get(), rootChain, false);
+	ExplorationTree::get()->setItemData(rootItem, itemData);
 
+	rootChain->addObject(rootDir);
 
+
 	wxFileName doll(wxT("data"), wxT("lalka.bmp"));
 	wxFileName dog(wxT("data"), wxT("pies.bmp"));
 	wxFileName foxes(wxT("data"), wxT("lisy.bmp"));
@@ -133,18 +125,7 @@
 	if (foxes.IsOk() && foxes.FileExists() && foxes.IsFileReadable())
 		rootDir->addFile(wxT("Foxes"), toString(foxes.GetFullPath()));
 
-
-	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
-	rootChain->addObject(rootDir);
-	rootChain->complete();
-
-	bool res = rootChain->realize();
-
-	if (!res) {
-		wxMessageBox(wxT("ObjectChain realisation failed."), wxT("Test1 Failed"),
-			wxOK | wxICON_ERROR, this);
-	}
-
+	ExplorationTree::get()->realizeVisible();
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -158,7 +139,6 @@
 	
 	//deleting the root
 	ExplorationTree::get()->deleteAllItems();
-
 }
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test2.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -30,6 +30,7 @@
 #include "PanelProvider.h"
 #include "FileTypeRecognizer.h"
 #include "TextPresenter.h"
+#include "HtmlPresenter.h"
 
 #include "scumm/ScummRecognizer.h"
 
@@ -50,11 +51,13 @@
 	PLUGGED_OBJECT(DirectoryPresenter)
 	PLUGGED_OBJECT(ImagePresenter)
 	PLUGGED_OBJECT(TextPresenter)
+	PLUGGED_OBJECT(HtmlPresenter)
 	PLUGGED_OBJECT(FileInfoPresenter)
 	PLUGGED_OBJECT(PanelProvider)
 
+	PLUGGED_OBJECT(TextParser)
+	PLUGGED_OBJECT(BinaryParser)
 	PLUGGED_OBJECT(BMPParser)
-	PLUGGED_OBJECT(TextParser)
 
 	PLUGGED_OBJECT(BinaryFileTypeRecognizer)
 	PLUGGED_OBJECT(BinaryFileTypeParserResolver)
@@ -66,7 +69,7 @@
 	PLUGGED_OBJECT(ScummFileTypeRecognizer)
 	PLUGGED_OBJECT(ScummFileTypeParserResolver)
 
-	//PLUGGED_OBJECT(ScummParser)
+	PLUGGED_OBJECT(ScummParser)
 	PLUGGED_OBJECT(ScummBlockPresenter)
 	PLUGGED_OBJECT(ScummBlockInfoPresenter)
 	PLUGGED_OBJECT(BlockyBlockPresenter)
@@ -86,21 +89,59 @@
 
 	RCPtr<RootDirectory> rootDir( new RootDirectory(rootItem) );
 
-	ExplorationTree::get()->setItemData(rootItem, new VirtualNodeItemData( rootDir.get() ) );
+	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	VirtualNodeItemData* itemData = new VirtualNodeItemData(rootDir.get(), rootChain, false);
+	ExplorationTree::get()->setItemData(rootItem, itemData);
 
+	rootChain->addObject(rootDir);
+
 	rootDir->addSubDir(wxT("data"), wxT("data"));
 
+	ExplorationTree::get()->realizeVisible();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+/*
+* OnOpen
+*/
+void MainForm::OnOpen(wxCommandEvent& event)
+{
+	//TODO: Make it better
+
+	int res = WxOpenFileDialog1->ShowModal();
+
+	if (res != wxID_OK)
+		return;
+
+	OnTest1Cleanup(event);
+
+
+	wxString fileName = WxOpenFileDialog1->GetPath();
+
+	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) );
+
 	ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+	VirtualNodeItemData* itemData = new VirtualNodeItemData(rootDir.get(), rootChain, false);
+	ExplorationTree::get()->setItemData(rootItem, itemData);
+
 	rootChain->addObject(rootDir);
-	rootChain->complete();
 
-	bool res = rootChain->realize();
 
-	if (!res) {
-		wxMessageBox(wxT("ObjectChain realisation failed."), wxT("Test2 Failed"),
-			wxOK | wxICON_ERROR, this);
-	}
+	//wxFileName doll(wxT("data"), wxT("lalka.bmp"));
+	//if (doll.IsOk() && doll.FileExists() && doll.IsFileReadable())
+	//	rootDir->addFile(wxT("Doll"), toString(doll.GetFullPath()));
+	//rootDir->addSubDir(wxT("data"), wxT("data"));
 
+	rootDir->addFile(fileName, fileName);
+
+	ExplorationTree::get()->realizeVisible();
 }
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -29,13 +29,6 @@
 	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;
 }
 
@@ -53,29 +46,37 @@
 
 
 coreString TextPresenter::getPanelTitle() {
+	_itext = _textSlot->getInterface();
+	if (!_itext) {
+		errout << wxT("TextPresenter::getPanelTitle(): could not get IText interface") << std::endl;
+		return wxT("ERROR");
+	}
+
 	return _itext->getTitle();
 }
 
 void TextPresenter::panelActivate(wxPanel* panel) {
 	//infoout << wxT("TextPresenter::panelActivate()") << std::endl;
 
+	_itext = _textSlot->getInterface();
+	if (!_itext) {
+		errout << wxT("TextPresenter::panelActivate(): could not get IText interface") << std::endl;
+		return;
+	}
+
 	const wxString& text = _itext->getText();
 
-	wxTextCtrl *textCtrl;
-	wxBoxSizer *WxBoxSizer1;
+	wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
 
-	WxBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
-	panel->SetSizer(WxBoxSizer1);
+	wxTextCtrl *textCtrl = new wxTextCtrl(panel, wxID_ANY, text, wxPoint(5,5), wxSize(400,435), wxTE_READONLY | wxTE_RICH | wxTE_MULTILINE, wxDefaultValidator, wxT("textCtrl"));
+	if (_itext->isMonospace())
+		textCtrl->SetFont(wxFont(8, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
+	panelsizer->Add(textCtrl,	1, wxALL|wxEXPAND, 0);
+
 	panel->SetAutoLayout(true);
+	panel->SetSizer(panelsizer);	
 
-	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();
+	panel->Layout();
 }
 
 void TextPresenter::panelDeactivate() {

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/TextPresenter.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -18,10 +18,10 @@
 	DECLARE_BOBJECT_CLASS(TextPresenter, BObject)
 
 protected:
-	Slot<ITextImpl>* _textSlot;
+	Slot<IText>* _textSlot;
 	Pin<IPanelReciever>* _panelRecieverPin;
 
-	ITextImpl* _itext;
+	IText* _itext;
 
 public:
 	ASSIGN_DESC(0, wxT("CoreObjects"), 1)

Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -17,17 +17,43 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-VirtualNodeItemData::VirtualNodeItemData(VirtualNode* node)
-	: _node(node) {}
+VirtualNodeItemData::VirtualNodeItemData(VirtualNode* node, ObjectChain* ochain, bool realized)
+	: _node(node), _ochain(ochain), _realized(realized) {}
 
-/*static*/ VirtualNode* VirtualNodeItemData::getNode(const wxTreeItemId& item) {
+VirtualNode* VirtualNodeItemData::getNode() {
+	return _node;
+}
+
+bool VirtualNodeItemData::getRealized() {
+	return _realized;
+}
+
+void VirtualNodeItemData::setRealized(bool realized) {
+	_realized = realized;
+}
+
+ObjectChain* VirtualNodeItemData::getObjectChain() {
+	return _ochain;
+}
+
+void VirtualNodeItemData::setObjectChain(ObjectChain* ochain) {
+	_ochain = ochain;
+}
+
+
+/*static*/ VirtualNodeItemData* VirtualNodeItemData::getForNode(const wxTreeItemId& item) {
 	if (!item.IsOk())
 		return NULL;
 	VirtualNodeItemData* data = static_cast<VirtualNodeItemData*>
 		(ExplorationTree::get()->getItemData(item));
+	return data;
+}
+
+/*static*/ VirtualNode* VirtualNodeItemData::getNode(const wxTreeItemId& item) {
+	VirtualNodeItemData* data = getForNode(item);
 	if (!data)
 		return NULL;
-	return data->_node;
+	return data->getNode();
 }
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -10,6 +10,9 @@
 #include <wx/image.h>
 #include "wx2scstream.h"
 
+#include <stdio.h>
+#include <string.h>
+
 #include "debugmem.h"
 
 namespace Browser {
@@ -29,14 +32,17 @@
 	//infoout << wxT("TextParser::getTextImpl(): ") << std::endl;
 
 	IFile* ifile = _fileSlot->getInterface();
-	if (!ifile)
-		return NULL;
+	if (!ifile) {
+		errout << wxT("TextParser::getTextImpl(): could not get IFile interface") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("could not get IFile interface"));
+	}
 	
 	Common::SeekableReadStream* stream = ifile->getStream();
 	
 	if (!stream) {
 		_fileSlot->releaseInterface();
-		return NULL;
+		errout << wxT("TextParser::getTextImpl(): null stream") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("null stream"));
 	}
 	
 	uint32 size = stream->size();
@@ -52,15 +58,164 @@
 	wxString str(toString(text));
 	delete [] text;
 
-	if (!res)
-		return NULL;
+	if (!res) {
+		errout << wxT("TextParser::getTextImpl(): stream ioFailed") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("stream ioFailed"));
+	}
 
-	return new ITextImpl(ifile->getName(), str);
+	return new ITextImpl(/*ifile->getName()*/ wxT("Text"), str);
 }
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+SLOT_DESCS_EX(BinaryParser)
+	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
+END_DESCS
+PIN_DESCS_EX(BinaryParser)
+	PIN_DESC_r(_textPin, PIN_DEFAULT | PIN_MULTICAST, getTextImpl, ITextImpl)
+END_DESCS
+
+//taken from ScummEx
+wxString _data_to_hex(byte* data, uint32 size, uint32 start_offset = 0, bool truncated = false) {
+
+	const int bytes_per_line = 8;
+	const int max_lines = 50;
+
+	uint32 orig_size = size;
+	if (size > bytes_per_line * max_lines) {
+		truncated = true;
+		size = bytes_per_line * max_lines;
+	}
+	int len = (int)size;
+	int nlines = len / bytes_per_line;
+
+	wxChar* text = new wxChar[
+		(16 + (3*bytes_per_line) + (bytes_per_line/4) + bytes_per_line) * nlines + 256];
+
+	int i;
+	uint32 offset = start_offset;
+	wxChar buf[256];
+	buf[0] = wxT('\0');
+	text[0] = wxT('\0');
+	while (len >= bytes_per_line) {
+		stprintf(buf, wxT("%06X: "), offset);
+		tstrcat(text, buf);
+		for (i = 0; i < bytes_per_line; i++) {
+			stprintf(buf, wxT("%02X "), data[i]);
+			tstrcat(text, buf);
+			if (i % 4 == 3) {
+				stprintf(buf, wxT(" "));
+				tstrcat(text, buf);
+			}
+		}
+		stprintf(buf, wxT(" |"));
+		tstrcat(text, buf);
+		for (i = 0; i < bytes_per_line; i++) {
+			wxChar c = data[i];
+			if (c < 32 || c >= 127)
+				c = wxT('.');
+			stprintf(buf, wxT("%c"), c);
+			tstrcat(text, buf);
+		}
+		stprintf(buf, wxT("|\n"));
+		tstrcat(text, buf);
+		data += bytes_per_line;
+		len -= bytes_per_line;
+		offset += bytes_per_line;
+	}
+
+	if (len > 0) {
+		stprintf(buf, wxT("%06X: "), offset);
+		tstrcat(text, buf);
+		for (i = 0; i < len; i++) {
+			stprintf(buf, wxT("%02X "), data[i]);
+			tstrcat(text, buf);
+			if (i % 4 == 3) {
+				stprintf(buf, wxT(" "));
+				tstrcat(text, buf);
+			}
+		}
+
+		for (; i < bytes_per_line; i++) {
+			stprintf(buf, wxT("   "));
+			tstrcat(text, buf);
+			if (i % 4 == 3) {
+				stprintf(buf, wxT(" "));
+				tstrcat(text, buf);
+			}
+		}
+		stprintf(buf, wxT(" |"));
+		tstrcat(text, buf);
+		for (i = 0; i < len; i++) {
+			wxChar c = data[i];
+			if (c < 32 || c >= 127)
+				c = wxT('.');
+			stprintf(buf, wxT("%c"), c);
+			tstrcat(text, buf);
+		}
+		for (; i < bytes_per_line; i++) {
+			stprintf(buf, wxT(" "));
+			tstrcat(text, buf);
+		}
+		stprintf(buf, wxT("|\n"));
+		tstrcat(text, buf);
+	}
+
+	if (truncated) {
+		stprintf(buf, wxT("\nThe file has been truncated.\n"));
+		tstrcat(text, buf);
+	}
+
+	wxString str(text);
+	delete [] text;	
+
+	return str;
+}
+
+ITextImpl* BinaryParser::getTextImpl() {
+	//infoout << wxT("BinaryParser::getTextImpl(): ") << std::endl;
+
+	IFile* ifile = _fileSlot->getInterface();
+	if (!ifile) {
+		errout << wxT("BinaryParser::getTextImpl(): could not get IFile interface") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("could not get IFile interface"));
+	}
+
+	Common::SeekableReadStream* stream = ifile->getStream();
+
+	if (!stream) {
+		_fileSlot->releaseInterface();
+		errout << wxT("BinaryParser::getTextImpl(): null stream") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("null stream"));
+	}
+	
+	uint32 size = stream->size();
+	bool truncated = size > 512;
+	if (truncated) size = 512;
+
+	byte* data = new byte[size];
+	stream->seek(0, SEEK_SET);
+	stream->read(data, size);
+	bool res = !stream->ioFailed();
+
+	_fileSlot->releaseInterface();
+
+	if (!res) {
+		delete [] data;
+		errout << wxT("BinaryParser::getTextImpl(): stream ioFailed") << std::endl;
+		return new ITextImpl(wxT("ERROR"), wxT("stream ioFailed"));
+	}
+
+	wxString str = _data_to_hex(data, size, 0, truncated);
+	delete [] data;
+
+	return new ITextImpl(/*ifile->getName()*/ wxT("Binary"), str, true);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 SLOT_DESCS_EX(BMPParser)
 	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
 END_DESCS
@@ -73,13 +228,16 @@
 	//infoout << wxT("BMPParser::getImageImpl(): ") << std::endl;
 
 	IFile* ifile = _fileSlot->getInterface();
-	if (!ifile)
+	if (!ifile) {
+		errout << wxT("BMPParser::getImageImpl(): could not get IFile interface") << std::endl;
 		return NULL;
-	
+	}
+
 	Common::SeekableReadStream* stream = ifile->getStream();
-	
+
 	if (!stream) {
 		_fileSlot->releaseInterface();
+		errout << wxT("BMPParser::getImageImpl(): null stream") << std::endl;
 		return NULL;
 	}
 	
@@ -93,6 +251,7 @@
 	_fileSlot->releaseInterface();
 
 	if (!res) {
+		errout << wxT("BMPParser::getImageImpl(): image LoadFile failed") << std::endl;
 		delete image;
 		return NULL;
 	}

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -33,6 +33,25 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+class BinaryParser : public BObject {
+	DECLARE_BOBJECT_CLASS(BinaryParser, 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)
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -8,6 +8,8 @@
 #include "VirtualNode.h"
 #include "ochain.h"
 
+#include "CoreFileTypes.h"
+
 #include "safe_static.h"
 
 #include "debugmem.h"
@@ -40,10 +42,8 @@
 	if (fileType != CoreFileTypes::binaryFileTypeGUID())
 		return ResolvedFileTypeParsers::NoParsers();
 
-	//FIXME: this is temporary
-	ASSERT_STATICS_ALLOWED();
-	static BGUID filePresenterGUID(wxT("CoreObjects"), wxT("FileInfoPresenter"), 1);
-	parsers.push_back(filePresenterGUID);
+	parsers.push_back(CoreFileTypes::binaryParserGUID());
+	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }
@@ -94,12 +94,8 @@
 
 	guid_list parsers;
 
-	//FIXME: this is temporary
-	ASSERT_STATICS_ALLOWED();
-	static BGUID textParserGUID(wxT("CoreObjects"), wxT("TextParser"), 1);
-	parsers.push_back(textParserGUID);
-	static BGUID filePresenterGUID(wxT("CoreObjects"), wxT("FileInfoPresenter"), 1);
-	parsers.push_back(filePresenterGUID);
+	parsers.push_back(CoreFileTypes::textParserGUID());
+	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }
@@ -131,12 +127,8 @@
 
 	guid_list parsers;
 
-	//FIXME: this is temporary
-	ASSERT_STATICS_ALLOWED();
-	static BGUID bmpParserGUID(wxT("CoreObjects"), wxT("BMPParser"), 1);
-	parsers.push_back(bmpParserGUID);
-	static BGUID filePresenterGUID(wxT("CoreObjects"), wxT("FileInfoPresenter"), 1);
-	parsers.push_back(filePresenterGUID);
+	parsers.push_back(CoreFileTypes::bmpParserGUID());
+	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/VirtualNode.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/VirtualNode.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/VirtualNode.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -18,13 +18,24 @@
 /////////////////////////////////////////////////////////////////////////////
 
 class VirtualNode;
+class ObjectChain;
 
-struct VirtualNodeItemData : public wxTreeItemData {
+class VirtualNodeItemData : public wxTreeItemData {
 	VirtualNode* _node;
+	bool _realized;
+	ObjectChain* _ochain;
 
-	VirtualNodeItemData(VirtualNode* node);
+public:
+	VirtualNodeItemData(VirtualNode* node, ObjectChain* ochain, bool realized);
 	//virtual ~VirtualNodeItemData() {}
 
+	VirtualNode* getNode();
+	bool getRealized();
+	void setRealized(bool realized);
+	ObjectChain* getObjectChain();
+	void setObjectChain(ObjectChain* ochain);
+
+	static VirtualNodeItemData* getForNode(const wxTreeItemId& item);
 	static VirtualNode* getNode(const wxTreeItemId& item);
 };
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -22,56 +22,78 @@
 END_DESCS
 PIN_DESCS_EX(ScummBlockInfoPresenter)
 	PIN_DESC_r(_textPin, PIN_DEFAULT | PIN_MULTICAST, getTextImpl, ITextImpl)
+	PIN_DESC_r(_urlPin, PIN_DEFAULT | PIN_MULTICAST, getUrlImpl, IUrlImpl)
 END_DESCS
 
 
-ITextImpl* ScummBlockInfoPresenter::getTextImpl() {
-	//infoout << wxT("ScummBlockInfoPresenter::getTextImpl(): ") << std::endl;
+void ScummBlockInfoPresenter::create() {
+	//infoout << wxT("ScummBlockInfoPresenter::create(): ") << std::endl;
+	if(_created)
+		return;
+	_created = true;
 
 	IProvider<FileNScummBlock>* iprov = _blockSlot->getInterface();
 	if (!iprov) {
-		errout << wxT("ScummBlockInfoPresenter::getTextImpl(): could not get IProvider<FileNScummBlock> interface") << std::endl;
-		return NULL;
+		errout << wxT("ScummBlockInfoPresenter::create(): could not get IProvider<FileNScummBlock> interface") << std::endl;
+		return;
 	}
 
 	ASSERT(iprov->getData());
 	ScummBlock* block = iprov->getData()->getBlock();
 
 	if (!block) {
-		errout << wxT("ScummBlockInfoPresenter::getTextImpl(): NULL block") << std::endl;
+		errout << wxT("ScummBlockInfoPresenter::create(): NULL block") << std::endl;
 		_blockSlot->releaseInterface();
-		return NULL;
+		return;
 	}
 
 	ScummTag* tag = block->getTag();
 	ASSERT(tag);
-	wxString name = tag->toString();
 
-	wxString text;
+	_title = tag->toString();
 
-	text << wxT("Block type: ") << name << wxEndl();
-	text << wxT("Size mode: ") << block->_sizeMode << wxEndl();
-	text << wxT("Size: ") << block->_size << wxEndl();
-	text << wxT("Data Size: ") << block->_dsize << wxEndl();
-	text << wxT("Read Data: ") << (block->_readData ? wxT("true") : wxT("false")) << wxEndl();
-	text << wxT("Parse Sub Blocks: ") << (block->_parseSubBlocks ? wxT("true") : wxT("false"))  << wxEndl();
-	text << wxT("Parsed: ") << (block->_parsed ? wxT("true") : wxT("false"))  << wxEndl();
-	text << wxEndl();
+	_text = wxT("");
+	_text << wxT("Block type: ") << _title << wxEndl();
+	_text << wxT("Size mode: ") << block->_sizeMode << wxEndl();
+	_text << wxT("Size: ") << block->_size << wxEndl();
+	_text << wxT("Data Size: ") << block->_dsize << wxEndl();
+	_text << wxT("Read Data: ") << (block->_readData ? wxT("true") : wxT("false")) << wxEndl();
+	_text << wxT("Parse Sub Blocks: ") << (block->_parseSubBlocks ? wxT("true") : wxT("false"))  << wxEndl();
+	_text << wxT("Parsed: ") << (block->_parsed ? wxT("true") : wxT("false"))  << wxEndl();
+	_text << wxEndl();
 
 	const blockInfo* binfo = getBlockInfo(*tag);
 	if (binfo) {
-		text << wxT("Description: ") << binfo->description << wxEndl();
-		text << wxT("Help: ") << binfo->htmlfile << wxEndl();
-		text << wxT("Icon: ") << binfo->iconid << wxEndl();
+		_text << wxT("Description: ") << binfo->description << wxEndl();
+		_text << wxT("Help: ") << binfo->htmlfile << wxEndl();
+		_text << wxT("Icon: ") << binfo->iconid << wxEndl();
+		_url = toString(binfo->htmlfile);
 	} else {
-		text << wxT("Could not find block info.") << wxEndl();
+		_text << wxT("Could not find block info.") << wxEndl();
+		_url = wxT("");
 	}
 
 	_blockSlot->releaseInterface();
+}
 
-	return new ITextImpl(name, text);
+ITextImpl* ScummBlockInfoPresenter::getTextImpl() {
+	//infoout << wxT("ScummBlockInfoPresenter::getTextImpl(): ") << std::endl;
+	create();
+	if (_text.IsEmpty())
+		return NULL;
+	return new ITextImpl(_title, _text);
 }
 
+IUrlImpl* ScummBlockInfoPresenter::getUrlImpl() {
+	//infoout << wxT("ScummBlockInfoPresenter::getUrlImpl(): ") << std::endl;
+	create();
+	if (_text.IsEmpty()) //empty _text marks invalid data
+		return new IUrlImpl(wxT("No help"));
+	if (_url.IsEmpty())
+		return new IUrlImpl(wxT("No help"));
+	return new IUrlImpl(wxT("Help"), _url);
+}
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockInfoPresenter.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -24,14 +24,23 @@
 protected:
 	Slot< IProvider<FileNScummBlock> >* _blockSlot;
 	Pin<IText>* _textPin;
+	Pin<IUrl>* _urlPin;
 
+	bool _created;
+	wxString _title, _text, _url;
+
 public:
 	ASSIGN_DESC(0,wxT("ScummObjects"), 1)
 
 	PINS_DECL
 	SLOTS_DECL
 
+	ScummBlockInfoPresenter()
+	: _created(false) {}
+
+	virtual void create();
 	ITextImpl* getTextImpl();
+	IUrlImpl* getUrlImpl();
 };
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -5,7 +5,7 @@
 
 #include "scumm/ScummBlockPresenter.h"
 #include "scumm/BlockyBlockPresenter.h"
-#include "scumm/ScummParser.h"
+#include "scumm/ScummRecognizer.h"
 
 #include "CoreInterfaces.h"
 
@@ -70,7 +70,7 @@
 		block = scummFile->getBlock();
 		_ownBlock = false;
 	} else {
-		block = ScummParser::getScummBlock(_ifile->getStream());
+		block = getScummBlock(_ifile->getStream());
 		_ownBlock = true;
 	}
 
@@ -93,6 +93,19 @@
 		new FileNScummBlock(_ifile, false, _block, false), true);
 }
 
+/*static*/ ScummBlock* ScummBlockPresenter::getScummBlock(Common::SeekableReadStream* stream) {
+	//infoout << wxT("ScummParser::getScummBlock(): ") << std::endl;
+
+	Common::SeekableReadStream* outStream;
+	ScummTag* outTag;
+	bool res = ScummFileTypeRecognizer::scummRecognize(stream, outStream, outTag);
+	if (!res)
+		return NULL;
+
+	ScummBlock* block = ScummBlockFactory::create(outTag, -1, outStream);
+	return block;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummBlockPresenter.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -40,6 +40,8 @@
 	}
 };
 
+//similar to ScummParser
+
 class ScummBlockPresenter : public BObject {
 	DECLARE_BOBJECT_CLASS(ScummBlockPresenter, BObject)
 
@@ -68,6 +70,8 @@
 
 	virtual void create();
 	IProviderImpl<FileNScummBlock>* getBlock();
+
+	static ScummBlock* getScummBlock(Common::SeekableReadStream* stream);
 };
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -5,8 +5,8 @@
 
 #include "scumm/ScummParser.h"
 
+#include "scumm/ScummFileTypes.h"
 #include "scumm/ScummRecognizer.h"
-#include "scumm/BlockyBlockPresenter.h"
 
 #include <iostream>
 
@@ -22,66 +22,42 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-SLOT_DESCS_EX(ScummParser)
-	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
-END_DESCS
-PIN_DESCS_EX(ScummParser)
-	PIN_DESC(_directoryPin, PIN_DEFAULT | PIN_MULTICAST, getScummBlockDirectory, releaseScummBlockDirectory)
-END_DESCS
+void ScummParser::create() {
+	//infoout << wxT("ScummParser::create(): ") << std::endl;
+	if (_created)
+		return;
+	_created = true;
 
-
-bool ScummParser::doRealize(ObjectChain* ochain) {
-	bool res = BObject::doRealize(ochain);
-	if (!res)
-		return false;
-
 	_ifile = _fileSlot->getInterface();
 	if (!_ifile) {
-		_realized = false;
-		return false;
+		errout << wxT("ScummParser::create(): could not get IFile interface") << std::endl;
+		return;
 	}
+	if (!_ifile->getStream()) {
+		errout << wxT("ScummParser::create(): null stream") << std::endl;
+		return;
+	}
 
-	return true;
-}
-
-void ScummParser::doUnrealize(ObjectChain* ochain) {
-	_ifile = NULL;
-	_fileSlot->releaseInterface();
-
-	BObject::doUnrealize(ochain);
-}
-
-
-IDirectory* ScummParser::getScummBlockDirectory() {
-	//infoout << wxT("ScummParser::getScummBlockDirectory(): ") << std::endl;
-
-	//TODO: make it work for scumm files with more than one root block
-	Common::SeekableReadStream* stream = _ifile->getStream();
-	ScummBlock* block = getScummBlock(stream);
-
-	IBlocksDirectoryImpl* idirectory = new IBlocksDirectoryImpl(_ifile->getParentDirectory(),
-									block->getTag()->toString(), block, true);
-	idirectory->setDirectoryFileType(_ifile->getFileType());
-
-	return idirectory;
-}
-
-void ScummParser::releaseScummBlockDirectory(IDirectory* iface) {
-	//infoout << wxT("ScummParser::releaseScummBlockDirectory(): ") << std::endl;
-	delete iface;
-}
-
-ScummBlock* ScummParser::getScummBlock(Common::SeekableReadStream* stream) {
-	//infoout << wxT("ScummParser::getScummBlock(): ") << std::endl;
-
 	Common::SeekableReadStream* outStream;
 	ScummTag* outTag;
-	bool res = ScummFileTypeRecognizer::scummRecognize(stream, outStream, outTag);
+	bool res = ScummFileTypeRecognizer::scummRecognize(_ifile->getStream(), outStream, outTag);
 	if (!res)
-		return NULL;
+		return;
 
+	delete outTag;
+
+	outTag = (_ifile->getFileType().getFileTypeGUID() == newScummFileType())
+						? (ScummTag*)new FourTag("****") : (ScummTag*)new TwoTag("**");
 	ScummBlock* block = ScummBlockFactory::create(outTag, -1, outStream);
-	return block;
+	_ownBlock = true;
+
+	if (!block) { // virtually impossible
+		delete outTag;
+		errout << wxT("ScummBlockPresenter::create(): null block") << std::endl;
+		return;
+	}
+
+	_block = block;
 }
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummParser.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -6,8 +6,7 @@
 
 #include "pinslot.h"
 
-#include "GUIInterfaces.h"
-#include "CoreInterfaces.h"
+#include "ScummBlockPresenter.h"
 
 #include "scumm/resource.h"
 
@@ -18,30 +17,15 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class ScummParser : public BObject {
-	DECLARE_BOBJECT_CLASS(ScummParser, BObject)
+//similar to ScummBlockPresenter
 
-protected:
-	Slot<IFile>* _fileSlot;
-	Pin<IDirectory>* _directoryPin;
+class ScummParser : public ScummBlockPresenter {
+	DECLARE_BOBJECT_CLASS(ScummParser, ScummBlockPresenter)
 
-	IFile* _ifile;
 public:
 	ASSIGN_DESC(0, wxT("ScummObjects"), 1)
 
-	PINS_DECL
-	SLOTS_DECL
-
-	ScummParser()
-		: _ifile(NULL) {}
-
-	virtual bool doRealize(ObjectChain* ochain);
-	virtual void doUnrealize(ObjectChain* ochain);
-
-	IDirectory* getScummBlockDirectory();
-	void releaseScummBlockDirectory(IDirectory* iface);
-
-	static ScummBlock* getScummBlock(Common::SeekableReadStream* stream);
+	virtual void create();
 };
 
 /////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummRecognizer.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummRecognizer.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/ScummRecognizer.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -87,9 +87,9 @@
 	delete outTag;
 
 	//HACK: temporary - we want LECF to be recognized as newScummFileType(), other blocks not
-	if (tag != wxT("LECF")) {
+	/*if (tag != wxT("LECF")) {
 		return RecognizedFileType(IDEAL_MATCH, tagGUID);
-	}
+	}*/
 
 	return RecognizedFileType(IDEAL_MATCH, newScumm ? newScummFileType() : oldScummFileType());
 }
@@ -102,8 +102,9 @@
 	if (fileType == newScummFileType() ||
 		fileType == oldScummFileType()) {
 		guid_list parsers;
-		parsers.push_back(scummBlockPresenterGUID());
-		parsers.push_back(scummBlockInfoPresenterGUID());
+		parsers.push_back(scummParserGUID());
+		//parsers.push_back(scummBlockPresenterGUID());
+		//parsers.push_back(scummBlockInfoPresenterGUID());
 		parsers.push_back(blockyBlockPresenterGUID());
 		parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
 		return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
@@ -112,7 +113,7 @@
 	if (fileType.facility == wxT("NewScummBlock") ||
 		fileType.facility == wxT("OldScummBlock")) {
 		guid_list parsers;
-		parsers = getScummBlockParsers(fileType);
+		parsers = ScummBlockFactory::getScummBlockParsers(fileType);
 		parsers.push_front(scummBlockPresenterGUID());
 		parsers.push_back(scummBlockInfoPresenterGUID());
 		parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.cpp	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.cpp	2007-07-09 12:17:15 UTC (rev 27990)
@@ -34,6 +34,7 @@
 
 #include "scumm/resource.h"
 #include "scumm/ScummFileTypes.h"
+#include "CoreFileTypes.h"
 
 #include <list>
 
@@ -364,10 +365,6 @@
 
 //utility function
 bool ScummBlock::doParseSubBlocks() {
-	uint32 hsize;
-	if (!determineHeaderSize(hsize))
-		return false;
-
 	while (true) {
 		uint32 pos = _mineStream->pos();
 		if (_mineStream->ioFailed())
@@ -399,6 +396,10 @@
 		}
 		uint32 kidSize = kidblock->_dsize;
 
+		uint32 hsize;
+		if (!kidblock->determineHeaderSize(hsize))
+			return false;
+
 		kidSize += hsize;
 		if (kidSize != end - pos) {
 			delete kidstream;
@@ -424,14 +425,13 @@
 class RawScummBlock : public ScummBlock {
 public:
 	RawScummBlock(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream)
-		: ScummBlock(tag, size, stream) {
-			ASSERT(_sizeMode == TILL_END);
-			ASSERT(!_readData);
-			ASSERT(!_parseSubBlocks);
-	}
+		: ScummBlock(tag, size, stream) {}
 
 	virtual bool parse() {
 		_parsed = true;
+		ASSERT(_sizeMode == TILL_END);
+		ASSERT(!_readData);
+		ASSERT(!_parseSubBlocks);
 		return true;
 	}
 
@@ -451,6 +451,43 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+//a ScummBlock that represents a root of a Scumm file - not a real block
+class RootScummBlock : public ScummBlock {
+public:
+	RootScummBlock(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream)
+		: ScummBlock(tag, size, stream) {}
+	/*RootScummBlock(bool newScumm, Common::SeekableReadStream* stream)
+		: ScummBlock( (newScumm ? (ScummTag*)new FourTag("****")
+								: (ScummTag*)new TwoTag("**")),
+						-1, stream) {}*/
+
+	virtual bool parse() {
+		ASSERT(_sizeMode == TILL_END);
+		ASSERT(!_readData);
+		ASSERT(_parseSubBlocks);
+		return ScummBlock::parse();
+	}
+
+protected:
+
+	virtual bool readHeader() {
+		uint32 outSize = _mineStream->size();
+		ASSERT( _size == -1 || _size == outSize );
+		_size = outSize;
+		ASSERT( (_tag->isNewTag() && _tag->toString() == wxT("****")) ||
+				(!_tag->isNewTag() && _tag->toString() == wxT("**")) );
+		return true;
+	}
+
+	virtual bool determineHeaderSize(uint32& outSize) {
+		outSize = 0;
+		return true;
+	}
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 struct sbCreator {
 	ScummTag* _tag;
 	guid_list _parsers;
@@ -486,7 +523,13 @@
 		:  sbCreator(tag, sizeMode, size, dsize, readData, parseSubBlocks) {}
 
 	virtual ScummBlock* create(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream) {
-		ASSERT(tag && tag->equals(*_tag));
+		ASSERT(tag);
+		wxString t = _tag->toString();
+		ASSERT(tag->equals(*_tag) ||
+				t == wxT("****") ||
+				t == wxT("**") ||
+				t == wxT("????") ||
+				t == wxT("??") );
 		ASSERT(stream);
 		ASSERT(_size == -1 || _size == size);
 		T* block = new T(tag, size, stream);
@@ -520,12 +563,19 @@
 		the_pair( wxString(wxT(tag)), &GENERATE_UNIQUE_IDENTIFIER_SUB(creator)) );
 
 #define BASIC_BLOCK(tag) \
-	SCUMM_BLOCK(ScummBlock, tag, INVALID_SIZE_MODE, -1, -1, false, false)
+	SCUMM_BLOCK(ScummBlock, tag, INVALID_SIZE_MODE, -1, -1, false, false) \
+	static int GENERATE_UNIQUE_IDENTIFIER_SUB(parser) = \
+		GENERATE_UNIQUE_IDENTIFIER_SUB(creator).addParser(CoreFileTypes::binaryParserGUID());
 #define BLOCKY_BLOCK(tag) \
 	SCUMM_BLOCK(ScummBlock, tag, INVALID_SIZE_MODE, -1, -1, false, true) \
 	static int GENERATE_UNIQUE_IDENTIFIER_SUB(parser) = \
 		GENERATE_UNIQUE_IDENTIFIER_SUB(creator).addParser(blockyBlockPresenterGUID());
 
+#define ROOT_BLOCK(tag) \
+	SCUMM_BLOCK(RootScummBlock, tag, TILL_END, -1, -1, false, true) \
+		static int GENERATE_UNIQUE_IDENTIFIER_SUB(parser) = \
+		GENERATE_UNIQUE_IDENTIFIER_SUB(creator).addParser(blockyBlockPresenterGUID());
+
 typedef std::map<wxString, sbCreator*> creator_map_t;
 const creator_map_t& sb_creators() {
 	ASSERT_STATICS_ALLOWED();
@@ -538,6 +588,14 @@
 	//static sbCreatorT<ScummBlock> creator(&tag, INVALID_SIZE_MODE, -1, -1, false, true);
 	//static ret_pair res = info_map.insert(wxT("tag"), &creator);
 
+	//Roots of a scumm file
+	ROOT_BLOCK("****")
+	ROOT_BLOCK("**")
+
+	//Unknown blocks
+	BASIC_BLOCK("????")
+	BASIC_BLOCK("??")
+
 	BASIC_BLOCK("ADL ")
 	BASIC_BLOCK("AMI ")
 	BASIC_BLOCK("APAL")
@@ -545,7 +603,7 @@
 	SCUMM_BLOCK(ScummBlock, "DATA", TILL_END, -1, -1, false, false) //TODO: probably not correct
 
 	BASIC_BLOCK("FRMT")
-	BASIC_BLOCK("GMD")
+	BASIC_BLOCK("GMD ")
 	SCUMM_BLOCK(ScummBlock, "iMUS", TILL_END, -1, -1, false, true) //TODO: probably not correct
 	BASIC_BLOCK("JUMP")
 
@@ -570,36 +628,48 @@
 
 	BLOCKY_BLOCK("WRAP") //FIXME: Is this ok? Shouldn't the OFFS subblock be used here?
 
-	//files
+	//FIXME: files?
 	BLOCKY_BLOCK(".IMC")
 	BLOCKY_BLOCK(".IMX")
 	BASIC_BLOCK(".LUA")
-	BASIC_BLOCK("TXT.")
+	BASIC_BLOCK(".TXT")
 	BLOCKY_BLOCK(".WAV")
 
 	return creators;
 }
 
-/*static*/ ScummBlock* ScummBlockFactory::create(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream) {
-	ASSERT(tag);
+/*static*/ sbCreator* ScummBlockFactory::getCreatorForTag(wxString tagName) {
+	ASSERT(tagName.Len() == 2 || tagName.Len() == 4);
+	bool newTag = tagName.Len() == 4;
+
+	bool unknown = false;
 	creator_map_t::const_iterator i;
-	wxString tagName = tag->toString();
 	i = sb_creators().find(tagName);
 	if (i == sb_creators().end()) {
-		return new ScummBlock(tag, size, stream); //revert to a default block when unknown
+		i = sb_creators().find(newTag ? wxT("????") : wxT("??"));
+		ASSERT(i != sb_creators().end());
+		unknown = true;
 	}
+
 	sbCreator* creator = i->second;
-	return creator->create(tag, size, stream);
+	return creator;
 }
 
-guid_list getScummBlockParsers(const BGUID& tagGUID) {
-	creator_map_t::const_iterator i;
+/*static*/ ScummBlock* ScummBlockFactory::create(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream) {
+	ASSERT(tag);
+	sbCreator* creator = ScummBlockFactory::getCreatorForTag(tag->toString());
+	ASSERT(creator);
+	ScummBlock* block = creator->create(tag, size, stream);
+
+	return block;
+}
+
+/*static*/ guid_list ScummBlockFactory::getScummBlockParsers(const BGUID& tagGUID) {
 	wxString tagName = tagGUID.identifier;
-	i = sb_creators().find(tagName);
-	if (i == sb_creators().end()) {
-		return guid_list();
-	}
-	sbCreator* creator = i->second;
+
+	sbCreator* creator = ScummBlockFactory::getCreatorForTag(tagName);
+
+	ASSERT(creator);
 	return creator->_parsers;
 }
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.h	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/scumm/resource.h	2007-07-09 12:17:15 UTC (rev 27990)
@@ -142,12 +142,13 @@
 /////////////////////////////////////////////////////////////////////////////
 
 class ScummBlock;
+struct sbCreator;
 
-guid_list getScummBlockParsers(const BGUID& tagGUID);
-
 class ScummBlockFactory {
 public:
+	static sbCreator* getCreatorForTag(wxString tagName);
 	static ScummBlock* create(ScummTag* tag, uint32 size, Common::SeekableReadStream* stream);
+	static guid_list getScummBlockParsers(const BGUID& tagGUID);
 };
 
 enum ScummChunkSizeMode {

Modified: scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj	2007-07-09 12:17:15 UTC (rev 27990)
@@ -288,6 +288,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\gui\HtmlPresenter.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\gui\ImagePresenter.cpp"
 				>
 			</File>
@@ -362,6 +366,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\gui\HtmlPresenter.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\gui\ImagePresenter.h"
 				>
 			</File>

Modified: scummex/branches/gsoc2007-gameresbrowser/vc8/vc8.sln
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/vc8/vc8.sln	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/vc8/vc8.sln	2007-07-09 12:17:15 UTC (rev 27990)
@@ -32,7 +32,6 @@
 		{D419FCD3-F34A-4937-BAFD-A90720366618}.Release|Win32.ActiveCfg = Release|Win32
 		{D419FCD3-F34A-4937-BAFD-A90720366618}.Release|Win32.Build.0 = Release|Win32
 		{D419FCD3-F34A-4937-BAFD-A90720366618}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
-		{D419FCD3-F34A-4937-BAFD-A90720366618}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
 		{A763B1FF-FE5B-493E-9AB9-722E038ED4A0}.Debug|Win32.ActiveCfg = Debug|Win32
 		{A763B1FF-FE5B-493E-9AB9-722E038ED4A0}.Debug|Win32.Build.0 = Debug|Win32
 		{A763B1FF-FE5B-493E-9AB9-722E038ED4A0}.Release|Win32.ActiveCfg = Release|Win32

Modified: scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout	2007-07-09 12:03:53 UTC (rev 27989)
+++ scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout	2007-07-09 12:17:15 UTC (rev 27990)
@@ -20,9 +20,9 @@
 Open=0
 Top=0
 [Editor_3]
-CursorCol=1
-CursorRow=169
-TopLine=139
+CursorCol=14
+CursorRow=168
+TopLine=148
 LeftChar=1
 Open=1
 Top=0


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