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

zbychs at users.sourceforge.net zbychs at users.sourceforge.net
Thu Jul 12 04:53:50 CEST 2007


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

Log Message:
-----------
Plugins are fully working under Windows. Linux version doesn't build yet.

Modified Paths:
--------------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryController.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/FileType.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.h
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.h
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.h
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.wxform
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainFormCommands.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test1.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test2.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/browserapp/guicon.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ObjectRegistry.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ObjectRegistry.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/core_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/functionalex.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/guid.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/guid.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot_detail.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/plugin.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/safe_static.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/tostring.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/AuxInterfaces.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/AuxInterfaces.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/BMPParser.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/BMPParser.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/BitmapPanel.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/BitmapPanel.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/DirectoryPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/DirectoryPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/DiskFileProvider.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/DiskFileProvider.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/FileInfoPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/FileInfoPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/HtmlPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/HtmlPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/ImagePresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/ImagePresenter.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/TextPresenter.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/TextPresenter.h
    scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.dev
    scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout

Added Paths:
-----------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.h
    scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/GUIDObject.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/ObjectChain.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ObjectChain.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/core.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/core.h
    scummex/branches/gsoc2007-gameresbrowser/src/core/core_static_stdafx.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/ReadMe.txt
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/basic_plugin.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/basic_plugin.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/basic_stdafx.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/basic_stdafx.h

Removed Paths:
-------------
    scummex/branches/gsoc2007-gameresbrowser/src/browser/plugin_api.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/CoreFileTypes.cpp
    scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/CoreFileTypes.h
    scummex/branches/gsoc2007-gameresbrowser/src/so/

Copied: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp (from rev 28031, scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/CoreFileTypes.cpp)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,49 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreFileTypes.cpp
+
+#include "browser_stdafx.h"
+
+#include "CoreFileTypes.h"
+
+#include "debugmem.h"
+
+namespace Browser {
+
+namespace CoreFileTypes {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// FileTypes
+
+SAFE_EXPORT_STATIC(BROWSER_API, binaryFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Binary File"), 1) )
+
+SAFE_EXPORT_STATIC(BROWSER_API, bmpFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Windows Bitmap File (BMP)"), 1) )
+
+SAFE_EXPORT_STATIC(BROWSER_API, textFileTypeGUID, BGUID, (wxT("CoreFileTypes"), wxT("Text File"), 1) )
+
+SAFE_EXPORT_STATIC(BROWSER_API, rootDirectoryFileType, RecognizedFileType,
+			(PERFECT_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Root Directory"), 1)) )
+
+SAFE_EXPORT_STATIC(BROWSER_API, diskDirectoryFileType, RecognizedFileType,
+			(PERFECT_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Disk Directory"), 1)) )
+
+//CAUTION: NO_MATCH here - so that Disk File is not considered a valid file type (it's only for informational/debug purposes)
+SAFE_EXPORT_STATIC(BROWSER_API, diskFileFileType, RecognizedFileType,
+			(NO_MATCH, BGUID(wxT("CoreFileTypes"), wxT("Disk File"), 1)) )
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Presenters TODO: move it to a different header
+
+SAFE_EXPORT_STATIC(BROWSER_API, fileInfoPresenterGUID, BGUID, (wxT("CoreObjects"), wxT("FileInfoPresenter"), 1) )
+
+SAFE_EXPORT_STATIC(BROWSER_API, textParserGUID, BGUID, (wxT("CoreObjects"), wxT("TextParser"), 1) )
+SAFE_EXPORT_STATIC(BROWSER_API, binaryParserGUID, BGUID, (wxT("CoreObjects"), wxT("BinaryParser"), 1) )
+SAFE_EXPORT_STATIC(BROWSER_API, bmpParserGUID, BGUID, (wxT("CoreObjects"), wxT("BMPParser"), 1) )
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace CoreFileTypes
+
+} // namespace Browser

Copied: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h (from rev 28031, scummex/branches/gsoc2007-gameresbrowser/src/plugins/basic/CoreFileTypes.h)
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreFileTypes.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// CoreFileTypes.h
+
+#ifndef _CORE_FILE_TYPES_H_
+#define _CORE_FILE_TYPES_H_
+
+#include "guid.h"
+#include "FileType.h"
+
+#include "safe_static.h"
+
+namespace Browser {
+
+namespace CoreFileTypes {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// FileTypes
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, binaryFileTypeGUID, BGUID)
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, bmpFileTypeGUID, BGUID)
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, textFileTypeGUID, BGUID)
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, rootDirectoryFileType, RecognizedFileType)
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, diskDirectoryFileType, RecognizedFileType)
+
+//CAUTION: NO_MATCH here - so that Disk File is not considered a valid file type (it's only for informational/debug purposes)
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, diskFileFileType, RecognizedFileType)
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+// Presenters TODO: move it to a different header
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, fileInfoPresenterGUID, BGUID)
+
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, textParserGUID, BGUID)
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, binaryParserGUID, BGUID)
+SAFE_EXPORT_STATIC_DECL(BROWSER_API, bmpParserGUID, BGUID)
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace CoreFileTypes
+
+} // namespace Browser
+
+#endif // _CORE_FILE_TYPES_H_

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -5,7 +5,7 @@
 
 #include "CoreInterfaces.h"
 #include "CoreFileTypes.h"
-#include "common/simplefile.h"
+#include "streams/simplefile.h"
 
 #include <iostream>
 
@@ -13,6 +13,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Concrete implementations of the interfaces
@@ -23,7 +25,7 @@
 		_ownInterfaces(ownInterfaces), _fileType(RecognizedFileType::NotRecognized()) {}
 
 IDirectoryImpl::IDirectoryImpl(IDirectory* parentDir, coreString name,
-			   const ifile_list& ifiles, const idir_list& isubdirs,
+			   const ifile_list_t& ifiles, const idir_list_t& isubdirs,
 			   bool ownInterfaces)
 	: _parentDir(parentDir), _name(name), _ifiles(ifiles), _isubdirs(isubdirs),
 		_ownInterfaces(ownInterfaces), _fileType(RecognizedFileType::NotRecognized()) {}
@@ -32,12 +34,12 @@
 	if (!_ownInterfaces)
 		return;
 
-	std::list<IFile*>::const_iterator i;
+	ifile_list_t::const_iterator i;
 	for (i = _ifiles.begin(); i != _ifiles.end(); ++i) {
 		delete *i;
 	}
 
-	std::list<IDirectory*>::const_iterator j;
+	idir_list_t::const_iterator j;
 	for (j = _isubdirs.begin(); j != _isubdirs.end(); ++j) {
 		delete *j;
 	}
@@ -59,12 +61,12 @@
 	_fileType = fileType;
 }
 
-const ifile_list& IDirectoryImpl::getFiles() {
+const ifile_list_t& IDirectoryImpl::getFiles() {
 	//infoout << wxT("IDirectoryImpl::getFiles()") << std::endl;
 	return _ifiles;
 }
 
-const idir_list& IDirectoryImpl::getSubDirs() {
+const idir_list_t& IDirectoryImpl::getSubDirs() {
 	//infoout << wxT("IDirectoryImpl::getSubDirs()") << std::endl;
 	return _isubdirs;
 }
@@ -161,4 +163,11 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+#include <wx/listimpl.cpp>
+WX_DEFINE_LIST(ifile_list_t);
+WX_DEFINE_LIST(idir_list_t);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 } // namespace Browser

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/CoreInterfaces.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -8,10 +8,12 @@
 #include "FileType.h"
 
 #include <list>
-#include "common/stream.h"
+#include "streams/stream.h"
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Interfaces
@@ -51,15 +53,26 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class IStream : public IInterface {
+class BROWSER_API IStream : public IInterface {
 public:
 	GUID_FOR(IStream, wxT("CoreInterfaces"), 1);
 	virtual Common::SeekableReadStream* getStream() = 0;
 };
 
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class IFile;
 class IDirectory;
 
-class IFile : public IStream {
+//look at those as std::list<IFile*>, std::list<IDirectory*>
+WX_DECLARE_LIST_WITH_DECL(IFile, ifile_list_t, class BROWSER_API);
+WX_DECLARE_LIST_WITH_DECL(IDirectory, idir_list_t, class BROWSER_API);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class BROWSER_API IFile : public IStream {
 public:
 	GUID_FOR(IFile, wxT("CoreInterfaces"), 1);
 	virtual const coreString& getName() = 0;
@@ -76,12 +89,12 @@
 //      It would enable disk files once opened, to be closed, memory
 //      once allocated, to be freed when not used anymore.
 //      Do it via dynamic dummy Slots?
-class IDirectory : public IInterface {
+class BROWSER_API IDirectory : public IInterface {
 public:
 	GUID_FOR(IDirectory, wxT("CoreInterfaces"), 1);
 	virtual const coreString& getName() = 0;
-	virtual const std::list<IFile*>& getFiles() = 0;
-	virtual const std::list<IDirectory*>& getSubDirs() = 0;
+	virtual const ifile_list_t& getFiles() = 0;
+	virtual const idir_list_t& getSubDirs() = 0;
 
 	//can be not set (returns a file type that is !isOk())
 	//it is a helper for recognizing files based on the type of the container
@@ -96,26 +109,23 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-typedef std::list<IFile*> ifile_list;
-typedef std::list<IDirectory*> idir_list;
+class BROWSER_API IDirectoryImpl : public IDirectory {
 
-class IDirectoryImpl : public IDirectory {
-
 protected:
 	coreString _name;
 	RecognizedFileType _fileType;
 	IDirectory* _parentDir;
 
 	bool _ownInterfaces;
-	ifile_list _ifiles;
-	idir_list _isubdirs;
+	ifile_list_t _ifiles;
+	idir_list_t _isubdirs;
 
 public:
 	//inherit guid - it's a concrete implementation of an abstract interface
 	IDirectoryImpl(IDirectory* parentDir, coreString name,
 		bool ownInterfaces);
 	IDirectoryImpl(IDirectory* parentDir, coreString name,
-		const ifile_list& ifiles, const idir_list& isubdirs,
+		const ifile_list_t& ifiles, const idir_list_t& isubdirs,
 		bool ownInterfaces);
 	virtual ~IDirectoryImpl();
 
@@ -130,15 +140,15 @@
 	void addFile(IFile* ifile);
 	void addSubDir(IDirectory* idir);
 
-	virtual const ifile_list& getFiles();
-	virtual const idir_list& getSubDirs();
+	virtual const ifile_list_t& getFiles();
+	virtual const idir_list_t& getSubDirs();
 };
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Concrete implementations of the interfaces
 
-class IStreamImpl : public IStream {
+class BROWSER_API IStreamImpl : public IStream {
 protected:
 	Common::SeekableReadStream* _stream;
 	bool _ownStream;
@@ -154,7 +164,7 @@
 // since virtual inheritance disallows casting from virtual base class (here:
 // IInterface) to a derived class (here: IFile).
 // Instead of multiple inheritance - I use encapsulation: _streamImpl member.
-class IFileImplBase : public IFile {
+class BROWSER_API IFileImplBase : public IFile {
 protected:
 	coreString _name;
 	RecognizedFileType _fileType;
@@ -173,7 +183,7 @@
 	virtual IDirectory* getParentDirectory();
 };
 
-class IStreamFileImpl : public IFileImplBase {
+class BROWSER_API IStreamFileImpl : public IFileImplBase {
 protected:
 	IStreamImpl _streamImpl;
 public:
@@ -182,7 +192,7 @@
 	virtual Common::SeekableReadStream* getStream();
 };
 
-class IDiskFileImpl : public IFileImplBase {
+class BROWSER_API IDiskFileImpl : public IFileImplBase {
 protected:
 	coreString _fullpath;
 	Common::SeekableReadStream* _stream;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 // Directories.cpp
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "Directories.h"
 #include "CoreFileTypes.h"
 
-#include "common/simplefile.h"
+#include "streams/simplefile.h"
 
 #include <iostream>
 
@@ -19,6 +19,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -36,8 +38,8 @@
 	IVirtualDirectoryImpl(IDirectory* parentDir, coreString name);
 	IVirtualDirectoryImpl(IDirectory* parentDir, coreString name, const str_pair_list& files, const str_pair_list& subdirs);
 
-	virtual const ifile_list& getFiles();
-	virtual const idir_list& getSubDirs();
+	virtual const ifile_list_t& getFiles();
+	virtual const idir_list_t& getSubDirs();
 
 	void addFile(coreString name, coreString fullpath);
 	void addSubDir(coreString name, coreString fullpath);
@@ -69,13 +71,13 @@
 		_files(files), _subdirs(subdirs), _created(false) {}
 
 
-const ifile_list& IVirtualDirectoryImpl::getFiles() {
+const ifile_list_t& IVirtualDirectoryImpl::getFiles() {
 	//infoout << wxT("IVirtualDirectoryImpl::getFiles()") << std::endl;
 	create();
 	return _ifiles;
 }
 
-const idir_list& IVirtualDirectoryImpl::getSubDirs() {
+const idir_list_t& IVirtualDirectoryImpl::getSubDirs() {
 	//infoout << wxT("IVirtualDirectoryImpl::getSubDirs()") << std::endl;
 	create();
 	return _isubdirs;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/Directories.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -10,6 +10,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -28,14 +30,20 @@
 class IDiskDirectoryImpl;
 typedef std::list< std::pair< coreString, coreString > > str_pair_list;
 
-class RootDirectory : public VirtualNode {
+class BROWSER_API RootDirectory : public VirtualNode {
 	DECLARE_BOBJECT_CLASS(RootDirectory, VirtualNode)
 
 protected:
 	Pin<IDirectory>* _directoryPin;
 
+#ifdef _MSC_VER
+#pragma warning(disable : 4251)
+#endif
 	str_pair_list _files;
 	str_pair_list _subdirs;
+#ifdef _MSC_VER
+#pragma warning(default : 4251)
+#endif
 
 	IVirtualDirectoryImpl* _idirectory;
 
@@ -60,7 +68,7 @@
 
 //not used now - but potentially useable
 
-class DiskDirectory : public VirtualNode {
+class BROWSER_API DiskDirectory : public VirtualNode {
 	DECLARE_BOBJECT_CLASS(DiskDirectory, VirtualNode)
 
 protected:

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryController.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryController.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/DirectoryController.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -6,10 +6,12 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class DirectoryController {
+class BROWSER_API DirectoryController {
 public:
 	virtual void expand() = 0;
 };

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,13 +1,13 @@
 /////////////////////////////////////////////////////////////////////////////
 // ExplorationTree.cpp
 
-#include "gui_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "ExplorationTree.h"
 #include "PanelProvider.h"
 #include "DirectoryController.h"
 
-#include "ochain.h"
+#include "ObjectChain.h"
 
 #include <iostream>
 
@@ -18,6 +18,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // private structs
@@ -139,7 +141,7 @@
 
 ExplorationTree::ExplorationTree()
 	: _explorationTree(NULL), _panelNotebook(NULL), _activeNode(NULL) {
-	_rootObjectChain = new ObjectChain();
+		_rootObjectChain = new ObjectChain();
 	_panelMap = new PanelMap();
 	_dirMap = new DirMap();
 	_notCompletedCount = 0;
@@ -198,7 +200,7 @@
 
 		//FIXME: This won't work for other DirectoryControllers - search for IS_DIRECTORY_CONTROLLER
 		ASSERT_STATICS_ALLOWED();
-		static directoryPresenterGUID(wxT("CoreObjects"), wxT("DirectoryController"), 1);
+		static BGUID directoryPresenterGUID(wxT("CoreObjects"), wxT("DirectoryPresenter"), 1);
 		//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
 		if (!kidchain->isContained(directoryPresenterGUID)) {
 			ExplorationTree::get()->deleteChildren(item); //delete the Dummy added by the ExplorationTree
@@ -228,12 +230,12 @@
 }
 
 void ExplorationTree::realizeVisible(bool dirsOnly /*= true*/) {
-	wxTreeItemId item = _explorationTree->GetFirstVisibleItem();
+	/*wxTreeItemId item = _explorationTree->GetFirstVisibleItem();
 	while (item.IsOk() &&
 		_explorationTree->IsVisible(item)) {  //WORKAROUND: in wxMSW this is necessary
 			realizeNode(item, dirsOnly);
 			item = _explorationTree->GetNextVisible(item);
-	}
+	}*/
 }
 
 bool ExplorationTree::isNodeRealized(const wxTreeItemId& item) {
@@ -262,15 +264,17 @@
 			data->setCompleted(true);
 		}
 
+		ASSERT_STATICS_ALLOWED();
+		static BGUID directoryPresenterGUID(wxT("CoreObjects"), wxT("DirectoryPresenter"), 1);
 		if (dirsOnly) {
-			if (kidchain->isContained(DirectoryController::static_GUID()))
+			if (kidchain->isContained(directoryPresenterGUID))
 				return true;
 			//WORKAROUND: in wxMSW SetItemHasChildren does not work, so we include a Dummy:
 			ExplorationTree::get()->deleteChildren(item); //delete the Dummy added by the ExplorationTree
 			return true;
 		}
 
-		if (!kidchain->isContained(DirectoryController::static_GUID()))
+		if (!kidchain->isContained(directoryPresenterGUID))
 			ExplorationTree::get()->deleteChildren(item); //delete the Dummy added by the ExplorationTree
 
 		wxString name = getItemText(item);

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/ExplorationTree.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -10,8 +10,14 @@
 #include <wx/treectrl.h>
 #include <wx/panel.h>
 
+namespace Core {
+	class ObjectChain;
+}
+
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -24,12 +30,11 @@
 class VirtualNode;
 class PanelProvider;
 class DirectoryController;
-class ObjectChain;
 
 //ExplorationTree's items does not hold any objects by reference. They do however hold
 //them via SetItemData( new VirtualNodeItemData(BObject*) ).
 //ExplorationTree holds objects by reference via _rootObjectChain, though.
-class ExplorationTree {
+class BROWSER_API ExplorationTree {
 	static ExplorationTree* _instance;
 
 	wxTreeCtrl* _explorationTree;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/FileType.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/FileType.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/FileType.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -8,6 +8,10 @@
 
 namespace Browser {
 
+using namespace Core;
+
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -47,35 +51,40 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-struct RecognizedFileType {
+struct BROWSER_API RecognizedFileType {
 	static const RecognizedFileType& NotRecognized();
 
+private:
 	FileTypeMatch _match;
 	BGUID _fileTypeGUID;
-	RecognizedFileType(FileTypeMatch match, const BGUID& fileTypeGUID)
-		: _match(match), _fileTypeGUID(fileTypeGUID) {}
 
+public:
+	RecognizedFileType(FileTypeMatch match, const BGUID& fileTypeGUID);
+	RecognizedFileType(); //HACK: for exporting std::vector<>
+
 	/*RecognizedFileType(const RecognizedFileType& other)
 		: _match(other._match), _fileTypeGUID(other._fileTypeGUID) {}
 	RecognizedFileType& operator=(const RecognizedFileType& other) {
 		_match = other._match; _fileTypeGUID = other._fileTypeGUID;
 	}*/
 
-	bool isOk() const {
-		return _match != NO_MATCH;
-	}
+	bool isOk() const;
+	const BGUID& getFileTypeGUID() const;
+	bool operator<(const RecognizedFileType& other) const;
+};
 
-	const BGUID& getFileTypeGUID() const {
-		return _fileTypeGUID;
-	}
 
-	bool operator<(const RecognizedFileType& other) const {
-		return this->_match < other._match;
-	}
-};
+#ifdef _MSC_VER
+#pragma warning(disable : 4251 4231)
+#endif
+BROWSER_API_TEMPLATE template class BROWSER_API std::vector<RecognizedFileType>;
+#ifdef _MSC_VER
+#pragma warning(default : 4251 4231)
+#endif
+typedef std::vector<RecognizedFileType> RecognizedFileTypes;
+//WX_DECLARE_OBJARRAY_WITH_DECL(RecognizedFileType, RecognizedFileTypes, class BROWSER_API);
+//typedef std::list<RecognizedFileType> RecognizedFileTypes;
 
-typedef std::list<RecognizedFileType> RecognizedFileTypes;
-
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 // FileTypeRecognizer.cpp
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "FileTypeRecognizer.h"
 
 #include "VirtualNode.h"
-#include "ochain.h"
+#include "ObjectChain.h"
 
 #include "CoreFileTypes.h"
 
@@ -16,20 +16,69 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
+
+//#include <wx/arrimpl.cpp> // this is a magic incantation which must be done!
+//WX_DEFINE_OBJARRAY(RecognizedFileTypes);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
 // Static fields
 
-SAFE_CLASS_STATIC(RecognizedFileType, NotRecognized, RecognizedFileType,
+SAFE_EXPORT_CLASS_STATIC(BROWSER_API, RecognizedFileType, NotRecognized, RecognizedFileType,
 				  (NO_MATCH, BGUID::Unknown()) )
 
-SAFE_STATIC(_empty_guid_list, guid_list, EMPTY_INITIALIZER)
-SAFE_CLASS_STATIC(ResolvedFileTypeParsers, NoParsers, ResolvedFileTypeParsers,
+SAFE_EXPORT_STATIC(BROWSER_API, _empty_guid_list, guid_list_t, SAFE_STATIC_EMPTY_INITIALIZER)
+SAFE_EXPORT_CLASS_STATIC(BROWSER_API, ResolvedFileTypeParsers, NoParsers, ResolvedFileTypeParsers,
 				  (NO_PARSERS, _empty_guid_list()) )
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+RecognizedFileType::RecognizedFileType() {} //HACK: for exporting std::vector<>
+
+RecognizedFileType::RecognizedFileType(FileTypeMatch match, const BGUID& fileTypeGUID)
+: _match(match), _fileTypeGUID(fileTypeGUID) {}
+
+bool RecognizedFileType::isOk() const {
+	return _match != NO_MATCH;
+}
+
+const BGUID& RecognizedFileType::getFileTypeGUID() const {
+	return _fileTypeGUID;
+}
+
+bool RecognizedFileType::operator<(const RecognizedFileType& other) const {
+	return this->_match < other._match;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+ResolvedFileTypeParsers::ResolvedFileTypeParsers(ResolvedParsersPriority priority,
+									const guid_list_t& parserGUIDs)
+									: _priority(priority), _parserGUIDs(parserGUIDs) {}
+
+ResolvedParsersPriority ResolvedFileTypeParsers::getPriority() {
+	return _priority;
+}
+
+const guid_list_t& ResolvedFileTypeParsers::getParsers() {
+	return _parserGUIDs;
+}
+bool ResolvedFileTypeParsers::isOk() {
+	return _priority != NO_PARSERS;
+}
+bool ResolvedFileTypeParsers::operator<(const ResolvedFileTypeParsers& other) const {
+	return this->_priority < other._priority;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 RecognizedFileType BinaryFileTypeRecognizer::recognize(VirtualFile* file) {
 	return RecognizedFileType(POOR_MATCH, CoreFileTypes::binaryFileTypeGUID());
 }
@@ -38,12 +87,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
 ResolvedFileTypeParsers BinaryFileTypeParserResolver::resolve(const BGUID& fileType) {
-	guid_list parsers;
+	guid_list_t parsers;
 	if (fileType != CoreFileTypes::binaryFileTypeGUID())
 		return ResolvedFileTypeParsers::NoParsers();
 
-	parsers.push_back(CoreFileTypes::binaryParserGUID());
-	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::binaryParserGUID()));
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::fileInfoPresenterGUID()));
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }
@@ -51,6 +100,10 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+SLOT_DESCS_EX(GenericFileTypeRecognizer)
+	SLOT_DESC(_fileSlot, SLOT_DEFAULT)
+END_DESCS
+
 RecognizedFileType GenericFileTypeRecognizer::recognize(VirtualFile* file) {
 	RCPtr<BObject> _file(file);
 	RCPtr<BObject> _this(this);
@@ -92,10 +145,10 @@
 	if (fileType != CoreFileTypes::textFileTypeGUID())
 		return ResolvedFileTypeParsers::NoParsers();
 
-	guid_list parsers;
+	guid_list_t parsers;
 
-	parsers.push_back(CoreFileTypes::textParserGUID());
-	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::textParserGUID()));
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::fileInfoPresenterGUID()));
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }
@@ -125,10 +178,10 @@
 	if (fileType != CoreFileTypes::bmpFileTypeGUID())
 		return ResolvedFileTypeParsers::NoParsers();
 
-	guid_list parsers;
+	guid_list_t parsers;
 
-	parsers.push_back(CoreFileTypes::bmpParserGUID());
-	parsers.push_back(CoreFileTypes::fileInfoPresenterGUID());
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::bmpParserGUID()));
+	parsers.push_back(&const_cast<BGUID&>(CoreFileTypes::fileInfoPresenterGUID()));
 
 	return ResolvedFileTypeParsers(IDEAL_PARSERS, parsers);
 }

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRecognizer.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -14,6 +14,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -33,23 +35,21 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-typedef std::list<BGUID> guid_list;
-
-struct ResolvedFileTypeParsers {
+struct BROWSER_API ResolvedFileTypeParsers {
 	static const ResolvedFileTypeParsers& NoParsers();
 
+private:
 	ResolvedParsersPriority _priority;
-	guid_list _parserGUIDs;
+	guid_list_t _parserGUIDs;
+
+public:
 	ResolvedFileTypeParsers(ResolvedParsersPriority priority,
-		const guid_list& parserGUIDs)
-		: _priority(priority), _parserGUIDs(parserGUIDs) {}
+		const guid_list_t& parserGUIDs);
 
-	bool isOk() {
-		return _priority != NO_PARSERS;
-	}
-	bool operator<(const ResolvedFileTypeParsers& other) const {
-		return this->_priority < other._priority;
-	}
+	ResolvedParsersPriority getPriority();
+	const guid_list_t& getParsers();
+	bool isOk();
+	bool operator<(const ResolvedFileTypeParsers& other) const;
 };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -57,7 +57,7 @@
 
 class VirtualFile;
 
-class FileTypeRecognizer {
+class BROWSER_API FileTypeRecognizer {
 public:
 	virtual RecognizedFileType recognize(VirtualFile* file) = 0;
 };
@@ -72,7 +72,7 @@
 
 //BinaryFileTypeRecognizer - a sample recognizer
 //this is a rather unusual BObject - it does not have any pins nor slots
-class BinaryFileTypeRecognizer : public BObject, public FileTypeRecognizer {
+class BROWSER_API BinaryFileTypeRecognizer : public BObject, public FileTypeRecognizer {
 	DECLARE_BOBJECT_CLASS(BinaryFileTypeRecognizer, BObject)
 
 public:
@@ -87,7 +87,7 @@
 
 //BinaryFileTypeParserResolver - a sample resolver
 //this is a rather unusual BObject - it does not have any pins nor slots
-class BinaryFileTypeParserResolver : public BObject, public FileTypeParserResolver {
+class BROWSER_API BinaryFileTypeParserResolver : public BObject, public FileTypeParserResolver {
 	DECLARE_BOBJECT_CLASS(BinaryFileTypeParserResolver, BObject)
 
 public:
@@ -100,7 +100,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 //utility base class for FileTypeRecognizers
-class GenericFileTypeRecognizer : public BObject, public FileTypeRecognizer {
+class BROWSER_API GenericFileTypeRecognizer : public BObject, public FileTypeRecognizer {
 	DECLARE_BOBJECT_CLASS(GenericFileTypeRecognizer, BObject)
 
 protected:
@@ -109,9 +109,7 @@
 public:
 	ASSIGN_DESC(IS_FILE_TYPE_RECOGNIZER, wxT("CoreObjects"), 1)
 
-	SLOT_DESCS
-		SLOT_DESC(_fileSlot, SLOT_DEFAULT)
-	END_DESCS
+	SLOTS_DECL
 
 	virtual RecognizedFileType recognize(VirtualFile* file);
 
@@ -122,7 +120,7 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class TextFileTypeRecognizer : public GenericFileTypeRecognizer {
+class BROWSER_API TextFileTypeRecognizer : public GenericFileTypeRecognizer {
 	DECLARE_BOBJECT_CLASS(TextFileTypeRecognizer, BObject)
 
 public:
@@ -134,7 +132,7 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class TextFileTypeParserResolver : public BObject, public FileTypeParserResolver {
+class BROWSER_API TextFileTypeParserResolver : public BObject, public FileTypeParserResolver {
 	DECLARE_BOBJECT_CLASS(TextFileTypeParserResolver, BObject)
 
 public:
@@ -146,7 +144,7 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class BMPFileTypeRecognizer : public GenericFileTypeRecognizer {
+class BROWSER_API BMPFileTypeRecognizer : public GenericFileTypeRecognizer {
 	DECLARE_BOBJECT_CLASS(BMPFileTypeRecognizer, BObject)
 
 public:
@@ -158,7 +156,7 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class BMPFileTypeParserResolver : public BObject, public FileTypeParserResolver {
+class BROWSER_API BMPFileTypeParserResolver : public BObject, public FileTypeParserResolver {
 	DECLARE_BOBJECT_CLASS(BMPFileTypeParserResolver, BObject)
 
 public:

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -5,7 +5,7 @@
 // Plugins are registered into FileTypeRegistry by ObjectRegistry.
 //
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "FileTypeRegistry.h"
 #include "ObjectRegistry.h"
@@ -17,6 +17,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // The FileTypeRegistry
@@ -42,8 +44,8 @@
 
 void FileTypeRegistry::registerPlugins() {
 
-	std::list<const ObjectPlugin*> plugins;
-	std::list<const ObjectPlugin*>::const_iterator j;
+	oplug_list_t plugins;
+	oplug_list_t::const_iterator j;
 	object_list::iterator i;
 	
 	plugins = ObjectRegistry::get()->findObjectsWithFlags(IS_FILE_TYPE_RECOGNIZER);
@@ -55,9 +57,11 @@
 			if (recognizer->get_GUID() == objGUID)
 				goto skip_recognizer;
 		}
+		{
 		RCPtr<BObject> recognizer( oplug->newInstance() );
 		_recognizers.push_back(recognizer);
-skip_recognizer:
+		}
+skip_recognizer:;
 	}
 
 	plugins = ObjectRegistry::get()->findObjectsWithFlags(IS_FILE_TYPE_RESOLVER);
@@ -69,9 +73,11 @@
 			if (resolver->get_GUID() == objGUID)
 				goto skip_resolver;
 		}
+		{
 		RCPtr<BObject> resolver( oplug->newInstance() );
 		_resolvers.push_back(resolver);
-skip_resolver:
+		}
+skip_resolver:;
 	}
 }
 
@@ -105,7 +111,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Parser resolving
 
-guid_list FileTypeRegistry::resolveParsers(VirtualFile* file, RecognizedFileType& outFileType) {
+guid_list_t FileTypeRegistry::resolveParsers(VirtualFile* file, RecognizedFileType& outFileType) {
 	RecognizedFileTypes fileTypes( recognizeFileType(file) );
 
 	RecognizedFileTypes::iterator i;
@@ -115,12 +121,12 @@
 		ResolvedFileTypeParsers parsers( resolveParsers(fileType) );
 		if (parsers.isOk()) {
 			outFileType = *i;
-			return parsers._parserGUIDs;
+			return parsers.getParsers();
 		}
 	}
 
 	outFileType = RecognizedFileType::NotRecognized();
-	return guid_list();
+	return guid_list_t();
 }
 
 ResolvedFileTypeParsers FileTypeRegistry::resolveParsers(const BGUID& fileType) {
@@ -137,7 +143,7 @@
 				bestParsers = parsers;
 			if (parsers < bestParsers)
 				bestParsers = parsers;
-			if (bestParsers._priority == IDEAL_PARSERS)
+			if (bestParsers.getPriority() == IDEAL_PARSERS)
 				return bestParsers;
 		}
 	}

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/FileTypeRegistry.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -17,24 +17,33 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // The FileTypeRegistry
 
 class VirtualFile;
 
-class FileTypeRegistry {
-public:
+class BROWSER_API FileTypeRegistry {
 	typedef std::list< RCPtr<BObject> > object_list;
+
+#ifdef _MSC_VER
+#pragma warning(disable : 4251)
+#endif
 	object_list _recognizers;
 	object_list _resolvers;
+#ifdef _MSC_VER
+#pragma warning(default : 4251)
+#endif
 
+public:
 	void registerPlugins();
 
 	//return properly sorted list of fileTypes
 	RecognizedFileTypes recognizeFileType(VirtualFile* file);
 
-	guid_list resolveParsers(VirtualFile* file, RecognizedFileType& outFileType);
+	guid_list_t resolveParsers(VirtualFile* file, RecognizedFileType& outFileType);
 
 	ResolvedFileTypeParsers resolveParsers(const BGUID& fileType);
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // GUIInterfaces.cpp
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "GUIInterfaces.h"
 
@@ -13,6 +13,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Concrete implementations of the interfaces

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/GUIInterfaces.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -10,11 +10,13 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // Interfaces
 
-class IImage : public IInterface {
+class BROWSER_API IImage : public IInterface {
 public:
 	GUID_FOR(IImage, wxT("GUIInterfaces"), 1)
 	virtual wxImage* getImage() = 0;
@@ -27,7 +29,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Concrete implementations of the interfaces
 
-class IImageImpl : public IImage {
+class BROWSER_API IImageImpl : public IImage {
 protected:
 	wxImage* _image;
 	bool _ownImage;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // PanelProvider.cpp
 
-#include "gui_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "PanelProvider.h"
 #include "ExplorationTree.h"
@@ -12,6 +12,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/PanelProvider.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -11,17 +11,19 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class PanelReciever {
+class BROWSER_API PanelReciever {
 public:
 	virtual coreString getPanelTitle() = 0;
 	virtual void panelActivate(wxPanel* panel) = 0;
 	virtual void panelDeactivate() = 0;
 };
 
-class IPanelReciever : public IInterface, public PanelReciever {
+class BROWSER_API IPanelReciever : public IInterface, public PanelReciever {
 public:
 	GUID_FOR(IPanelReciever, wxT("CoreInterfaces"), 1);
 };
@@ -30,7 +32,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 //IPanelRecieverImpl delegates method invocations to the apropraiate PanelReciever (_that)
-class IPanelRecieverImpl : public IPanelReciever {
+class BROWSER_API IPanelRecieverImpl : public IPanelReciever {
 protected:
 	PanelReciever* _that;
 public:
@@ -59,7 +61,7 @@
 //  PanelProvider is then delegating PanelReciever methods from ExplorationTree,
 //  via IPanelReciever slot, to the proper object.
 
-class PanelProvider : public BObject, public PanelReciever {
+class BROWSER_API PanelProvider : public BObject, public PanelReciever {
 	DECLARE_BOBJECT_CLASS(PanelProvider, BObject)
 
 protected:

Added: scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,132 @@
+/////////////////////////////////////////////////////////////////////////////
+// Plugin API
+
+#include "browser_stdafx.h"
+
+#include "PluginUtil.h"
+#include "ObjectRegistry.h"
+
+#include <wx/stdpaths.h>
+#include <wx/filename.h>
+#include <wx/dynlib.h>
+
+#include <iostream>
+
+#include "safe_static.h"
+
+#include "debugmem.h"
+
+namespace Browser {
+
+namespace PluginUtil {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+SAFE_LOCAL_MUTABLE_STATIC(_mainForm, wxFrame*, (NULL))
+
+BROWSER_API wxFrame* getMainForm() {
+	return _mainForm();
+}
+
+BROWSER_API void setMainForm(wxFrame* mainForm) {
+	_mainForm() = mainForm;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//outputs a Native path
+BROWSER_API wxString getResourcesDir() {
+#ifdef UNIX
+	wxFileName execFN(wxStandardPaths::Get().GetExecutablePath());
+	wxStandardPaths::Get().SetInstallPrefix(execFN.GetPath());
+#endif
+	wxString dataDir = wxStandardPaths::Get().GetResourcesDir();
+	return dataDir;
+}
+
+//expects input as Linux path relative to the resources dir, outputs a Native path
+BROWSER_API wxString getResourcePath(const wxString& resourceName) {
+	wxString dataDir = getResourcesDir();
+	wxFileName dataFN(dataDir, wxEmptyString, wxPATH_NATIVE);
+	wxFileName resFN(resourceName, wxPATH_UNIX);
+	for (size_t i = 0; i < resFN.GetDirCount(); ++i)
+		dataFN.AppendDir(resFN.GetDirs()[i]);
+	if (resFN.HasName())
+		dataFN.SetName(resFN.GetName());
+	if (resFN.HasExt())
+		dataFN.SetExt(resFN.GetExt());
+	return dataFN.GetFullPath(wxPATH_NATIVE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//outputs a Native path
+BROWSER_API wxString getPluginsDir() {
+#ifdef UNIX
+	wxFileName execFN(wxStandardPaths::Get().GetExecutablePath());
+	wxStandardPaths::Get().SetInstallPrefix(execFN.GetPath());
+#endif
+	wxString dataDir = wxStandardPaths::Get().GetPluginsDir();
+	return dataDir;
+}
+
+//expects input as Linux path relative to the resources dir, outputs a Native path
+BROWSER_API wxString getPluginPath(const wxString& pluginName) {
+	wxString dataDir = getPluginsDir();
+	wxFileName dataFN(dataDir, wxEmptyString, wxPATH_NATIVE);
+	wxFileName resFN(pluginName, wxPATH_UNIX);
+	for (size_t i = 0; i < resFN.GetDirCount(); ++i)
+		dataFN.AppendDir(resFN.GetDirs()[i]);
+	if (resFN.HasName())
+		dataFN.SetName(resFN.GetName());
+	if (resFN.HasExt())
+		dataFN.SetExt(resFN.GetExt());
+	return dataFN.GetFullPath(wxPATH_NATIVE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+SAFE_LOCAL_MUTABLE_STATIC(_plugins, std::list<wxDynamicLibrary*>, SAFE_STATIC_EMPTY_INITIALIZER);
+
+//expects a native path
+BROWSER_API bool loadPlugin(wxString pluginPath) {
+	infoout << wxT("Registering plugin: ") << pluginPath << std::endl;
+
+	wxDynamicLibrary* plugin = new wxDynamicLibrary(pluginPath);
+	if (plugin->IsLoaded()) {
+
+		void* accessor = plugin->GetSymbol(wxT("getPlugin"));
+		if (accessor) {
+			ObjectRegistry::get()->registerPlugin((ObjectRegistry::PluginAccessor)accessor, false);
+			_plugins().push_back(plugin);
+			infoout << wxT("Registering plugin succeded: ") << pluginPath << std::endl;
+			return true;
+		}
+		errout << wxT("Loaded, but no getPlugin() symbol.") << std::endl;
+	}
+
+	errout << wxT("Registering plugin failed: ") << pluginPath << std::endl;
+	delete plugin;
+	return false;
+}
+
+BROWSER_API void unloadAllPlugins() {
+	infoout << wxT("Unloading plugins") << std::endl;
+
+	std::list<wxDynamicLibrary*>::iterator i;
+	for (i = _plugins().begin(); i != _plugins().end(); ++i) {
+		delete *i;
+	}
+	_plugins().clear();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace PluginUtil
+
+} // namespace Browser


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

Added: scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/PluginUtil.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////
+// Plugin API
+
+
+namespace Browser {
+
+namespace PluginUtil {
+
+using namespace Core;
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+BROWSER_API wxFrame* getMainForm();
+BROWSER_API void setMainForm(wxFrame* mainForm);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//outputs a Native path
+BROWSER_API wxString getResourcesDir();
+
+//expects input as Linux path relative to the resources dir, outputs a Native path
+BROWSER_API wxString getResourcePath(const wxString& resourceName);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//outputs a Native path
+BROWSER_API wxString getPluginsDir();
+
+//expects input as Linux path relative to the resources dir, outputs a Native path
+BROWSER_API wxString getPluginPath(const wxString& pluginName);
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//expects a native path
+BROWSER_API bool loadPlugin(wxString pluginPath);
+BROWSER_API void unloadAllPlugins();
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+} // namespace PluginUtil
+
+} // namespace Browser


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

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,12 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 // VirtualNode.cpp
 
-#include "gui_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "VirtualNode.h"
 
 #include "ExplorationTree.h"
-#include "common/simplefile.h"
+#include "streams/simplefile.h"
 
 #include <iostream>
 
@@ -14,6 +14,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
@@ -85,6 +87,25 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+VirtualNode::VirtualNode(wxTreeItemId mineTreeItem)
+: _mineTreeItem(mineTreeItem) {
+	ASSERT(_mineTreeItem.IsOk());
+}
+
+/*const coreString& getName() {
+return _name;
+}*/
+
+wxTreeItemId VirtualNode::getTreeItem() {
+	ASSERT(_mineTreeItem.IsOk());
+	return _mineTreeItem;
+}
+
+void VirtualNode::setTreeItem(wxTreeItemId mineTreeItem) {
+	ASSERT(mineTreeItem.IsOk());
+	_mineTreeItem = mineTreeItem;
+}
+
 VirtualNode* VirtualNode::getParent() {
 	ASSERT(_mineTreeItem.IsOk());
 	wxTreeItemId parentTreeItem = ExplorationTree::get()->getItemParent(_mineTreeItem);
@@ -115,4 +136,69 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+PIN_DESCS_EX(VirtualFile)
+	PIN_DESC(_filePin, PIN_DEFAULT | PIN_MULTICAST, getFile, releaseFile)
+	PIN_DESC(_streamPin, PIN_DEFAULT | PIN_MULTICAST, getFile, releaseFile)
+END_DESCS
+
+VirtualFile::VirtualFile(wxTreeItemId mineTreeItem, IFile* ifile)
+: VirtualNode(mineTreeItem), _taken(0), _ifile(ifile) {}
+
+VirtualFile::~VirtualFile() {
+	ASSERT(_taken == 0);
 }
+
+IFile* VirtualFile::getFile() {
+	_taken++;
+	return _ifile;
+}
+void VirtualFile::releaseFile(IFile* iface) {
+	_taken--;
+}
+
+bool VirtualFile::isTaken() {
+	return _taken > 0;
+}
+
+coreString VirtualFile::dumpName() {
+	if (!_ifile)
+		return wxT("VirtualFile-NULL_ifile");
+	return _ifile->getName();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(VirtualDirectory)
+	PIN_DESC(_directoryPin, PIN_DEFAULT | PIN_MULTICAST, getDirectory, releaseDirectory)
+END_DESCS
+
+VirtualDirectory::VirtualDirectory(wxTreeItemId mineTreeItem, IDirectory* idirectory)
+: VirtualNode(mineTreeItem), _taken(0), _idirectory(idirectory) {}
+
+VirtualDirectory::~VirtualDirectory() {
+	ASSERT(_taken == 0);
+}
+
+IDirectory* VirtualDirectory::getDirectory() {
+	_taken++;
+	return _idirectory;
+}
+void VirtualDirectory::releaseDirectory(IDirectory* iface) {
+	_taken--;
+}
+
+bool VirtualDirectory::isTaken() {
+	return _taken > 0;
+}
+
+coreString VirtualDirectory::dumpName() {
+	if (!_idirectory)
+		return wxT("VirtualDirectory-NULL_idirectory");
+	return _idirectory->getName();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+}

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/VirtualNode.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -4,7 +4,7 @@
 #ifndef _VIRTUAL_NODE_H_
 #define _VIRTUAL_NODE_H_
 
-#include "core_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "pinslot.h"
 
@@ -12,15 +12,20 @@
 
 #include <wx/treectrl.h> //for wxTreeItemId
 
+namespace Core {
+	class ObjectChain;
+}
+
 namespace Browser {
 
+using namespace Core;
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
 class VirtualNode;
-class ObjectChain;
 
-class VirtualNodeItemData : public wxTreeItemData {
+class BROWSER_API VirtualNodeItemData : public wxTreeItemData {
 	VirtualNode* _node;
 	bool _realized;
 	bool _completed;
@@ -45,7 +50,7 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-class INodeProvider : public IInterface {
+class BROWSER_API INodeProvider : public IInterface {
 public:
 	GUID_FOR(INodeProvider, wxT("CoreInterfaces"), 1);
 	virtual VirtualNode* getNode() = 0;
@@ -57,7 +62,7 @@
 class INodeProviderImpl;
 
 //TODO: make it realizable in multiple chains
-class VirtualNode : public BObject {
+class BROWSER_API VirtualNode : public BObject {
 	DECLARE_BOBJECT_CLASS(VirtualNode, BObject)
 
 	//coreString _name;
@@ -72,25 +77,12 @@
 
 	PINS_DECL
 
-	VirtualNode(wxTreeItemId mineTreeItem)
-		: _mineTreeItem(mineTreeItem) {
-		ASSERT(_mineTreeItem.IsOk());
-	}
+	VirtualNode(wxTreeItemId mineTreeItem);
 
-	/*const coreString& getName() {
-		return _name;
-	}*/
-
-	wxTreeItemId getTreeItem() {
-		ASSERT(_mineTreeItem.IsOk());
-		return _mineTreeItem;
-	}
+	wxTreeItemId getTreeItem();
 	wxString getTreeItemName();
 
-	void setTreeItem(wxTreeItemId mineTreeItem) {
-		ASSERT(mineTreeItem.IsOk());
-		_mineTreeItem = mineTreeItem;
-	}
+	void setTreeItem(wxTreeItemId mineTreeItem);
 
 	VirtualNode* getParent();
 
@@ -102,7 +94,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 //this class defines an object that can deliver given IFile interface
-class VirtualFile : public VirtualNode {
+class BROWSER_API VirtualFile : public VirtualNode {
 	DECLARE_BOBJECT_CLASS(VirtualFile, VirtualNode)
 
 protected:
@@ -115,42 +107,24 @@
 public:
 	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
 
-	PIN_DESCS
-		PIN_DESC(_filePin, PIN_DEFAULT | PIN_MULTICAST, getFile, releaseFile)
-		PIN_DESC(_streamPin, PIN_DEFAULT | PIN_MULTICAST, getFile, releaseFile)
-	END_DESCS
+	PINS_DECL
 
-	VirtualFile(wxTreeItemId mineTreeItem, IFile* ifile)
-		: VirtualNode(mineTreeItem), _taken(0), _ifile(ifile) {}
+	VirtualFile(wxTreeItemId mineTreeItem, IFile* ifile);
+	~VirtualFile();
 
-	~VirtualFile() {
-		ASSERT(_taken == 0);
-	}
+	IFile* getFile();
+	void releaseFile(IFile* iface);
 
-	IFile* getFile() {
-		_taken++;
-		return _ifile;
-	}
-	void releaseFile(IFile* iface) {
-		_taken--;
-	}
+	bool isTaken();
 
-	bool isTaken() {
-		return _taken > 0;
-	}
-
-	virtual coreString dumpName() {
-		if (!_ifile)
-			return wxT("VirtualFile-NULL_ifile");
-		return _ifile->getName();
-	}
+	virtual coreString dumpName();
 };
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
 //this class defines an object that can deliver given IDirectory interface
-class VirtualDirectory : public VirtualNode {
+class BROWSER_API VirtualDirectory : public VirtualNode {
 	DECLARE_BOBJECT_CLASS(VirtualDirectory, VirtualNode)
 
 protected:
@@ -162,34 +136,18 @@
 public:
 	ASSIGN_DESC(0,wxT("CoreObjects"), 1)
 
-	PIN_DESCS
-		PIN_DESC(_directoryPin, PIN_DEFAULT | PIN_MULTICAST, getDirectory, releaseDirectory)
-	END_DESCS
+	PINS_DECL
 
-	VirtualDirectory(wxTreeItemId mineTreeItem, IDirectory* idirectory)
-		: VirtualNode(mineTreeItem), _taken(0), _idirectory(idirectory) {}
+	VirtualDirectory(wxTreeItemId mineTreeItem, IDirectory* idirectory);
 
-	~VirtualDirectory() {
-		ASSERT(_taken == 0);
-	}
+	~VirtualDirectory();
 
-	IDirectory* getDirectory() {
-		_taken++;
-		return _idirectory;
-	}
-	void releaseDirectory(IDirectory* iface) {
-		_taken--;
-	}
+	IDirectory* getDirectory();
+	void releaseDirectory(IDirectory* iface);
 
-	bool isTaken() {
-		return _taken > 0;
-	}
+	bool isTaken();
 
-	virtual coreString dumpName() {
-		if (!_idirectory)
-			return wxT("VirtualDirectory-NULL_idirectory");
-		return _idirectory->getName();
-	}
+	virtual coreString dumpName();
 };
 
 /////////////////////////////////////////////////////////////////////////////

Added: scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.cpp	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,36 @@
+// browser.cpp : Defines the entry point for the DLL application.
+//
+
+#include "browser_stdafx.h"
+#include "browser.h"
+
+
+//#ifdef _MANAGED
+//#pragma managed(push, off)
+//#endif
+//#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+//#include <windows.h>
+
+#ifdef _MSC_VER
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+    return TRUE;
+}
+
+#endif //_MSC_VER
+
+//#ifdef _MANAGED
+//#pragma managed(pop)
+//#endif


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

Added: scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.h	                        (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/browser.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -0,0 +1,13 @@
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the BROWSER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// BROWSER_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef BROWSER_EXPORTS
+	#define BROWSER_API __declspec(dllexport)
+	#define BROWSER_API_TEMPLATE
+#else
+	#define BROWSER_API __declspec(dllimport)
+	#define BROWSER_API_TEMPLATE extern
+#endif


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

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/browser_stdafx.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -9,6 +9,7 @@
 // TODO: reference additional headers your program requires here
 
 #include "core_stdafx.h"
+#include "browser.h"
 
 #include <wx/wxprec.h>
 

Deleted: scummex/branches/gsoc2007-gameresbrowser/src/browser/plugin_api.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/plugin_api.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/plugin_api.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -1,91 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Plugin API
-
-#include "gui_stdafx.h"
-
-#include "MainForm.h"
-#include "ExplorationTree.h"
-#include "VirtualNode.h"
-
-#include <iostream>
-#include <list>
-
-#include <wx/filedlg.h>
-#include <wx/wfstream.h>
-#include <wx/stdpaths.h>
-
-#include "ochain.h"
-
-#include "debugmem.h"
-
-using namespace Browser;
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-//outputs a Native path
-wxString getResourcesDir() {
-#ifdef UNIX
-	wxFileName execFN(wxStandardPaths::Get().GetExecutablePath());
-	wxStandardPaths::Get().SetInstallPrefix(execFN.GetPath());
-#endif
-	wxString dataDir = wxStandardPaths::Get().GetResourcesDir();
-	return dataDir;
-}
-
-//expects input as Linux path relative to the resources dir, outputs a Native path
-wxString getResourcePath(const wxString& resourceName) {
-	wxString dataDir = getResourcesDir();
-	wxFileName dataFN(dataDir, wxEmptyString, wxPATH_NATIVE);
-	wxFileName resFN(resourceName, wxPATH_UNIX);
-	for (int i = 0; i < resFN.GetDirCount(); ++i)
-		dataFN.AppendDir(resFN.GetDirs()[i]);
-	if (resFN.HasName())
-		dataFN.SetName(resFN.GetName());
-	if (resFN.HasExt())
-		dataFN.SetExt(resFN.GetExt());
-	return dataFN.GetFullPath(wxPATH_NATIVE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-//outputs a Native path
-wxString getPluginsDir() {
-#ifdef UNIX
-	wxFileName execFN(wxStandardPaths::Get().GetExecutablePath());
-	wxStandardPaths::Get().SetInstallPrefix(execFN.GetPath());
-#endif
-	wxString dataDir = wxStandardPaths::Get().GetPluginsDir();
-	return dataDir;
-}
-
-//expects input as Linux path relative to the resources dir, outputs a Native path
-wxString getPluginPath(const wxString& pluginName) {
-	wxString dataDir = getPluginsDir();
-	wxFileName dataFN(dataDir, wxEmptyString, wxPATH_NATIVE);
-	wxFileName resFN(pluginName, wxPATH_UNIX);
-	for (int i = 0; i < resFN.GetDirCount(); ++i)
-		dataFN.AppendDir(resFN.GetDirs()[i]);
-	if (resFN.HasName())
-		dataFN.SetName(resFN.GetName());
-	if (resFN.HasExt())
-		dataFN.SetExt(resFN.GetExt());
-	return dataFN.GetFullPath(wxPATH_NATIVE);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef UNIX
-#include <dlfcn.h>
-#endif
-
-bool loadPlugin(wxString nativePath) {
-	infoout << wxT("Registering plugin: ") << nativePath << std::endl;
-	LoadLibrary
-		ObjectRegistry::get()->registerPlugin( &getTest2Plugin, false );
-}
-
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -21,7 +21,7 @@
  */
 
 #include "browser_stdafx.h"
-#include "streams/streams_stdafx.h.h"
+#include "streams/streams_stdafx.h"
 
 #include "streams/simplefile.h"
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/simplefile.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -23,12 +23,12 @@
 #ifndef COMMON_SIMPLEFILE_H
 #define COMMON_SIMPLEFILE_H
 
-#include "streams/streams_stdafx.h.h"
+#include "streams/streams_stdafx.h"
 #include "streams/stream.h"
 
 namespace Common {
 
-class SimpleFile : public SeekableReadStream, public WriteStream {
+class BROWSER_API SimpleFile : public SeekableReadStream, public WriteStream {
 protected:
 	/** File handle to the actual file; 0 if no file is open. */
 	FILE *_handle;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -21,7 +21,7 @@
  */
 
 #include "browser_stdafx.h"
-#include "streams/streams_stdafx.h.h"
+#include "streams/streams_stdafx.h"
 
 //#include "streams/stdafx.h"
 #include "streams/stream.h"

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/stream.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -25,18 +25,18 @@
 #ifndef COMMON_STREAM_H
 #define COMMON_STREAM_H
 
-#include "streams/streams_stdafx.h.h"
+#include "streams/streams_stdafx.h"
 #include "streams/scummsys.h"
 
 namespace Common {
 
 //class String;
-class MemoryReadStream;
+class BROWSER_API MemoryReadStream;
 
 /**
  * Virtual base class for both ReadStream and WriteStream.
  */
-class Stream {
+class BROWSER_API Stream {
 public:
 	virtual ~Stream() {}
 
@@ -59,7 +59,7 @@
 /**
  * Generic interface for a writable data stream.
  */
-class WriteStream : virtual public Stream {
+class BROWSER_API WriteStream : virtual public Stream {
 public:
 	/**
 	 * Write data into the stream. Subclasses must implement this
@@ -132,7 +132,7 @@
 /**
  * Generic interface for a readable data stream.
  */
-class ReadStream : virtual public Stream {
+class BROWSER_API ReadStream : virtual public Stream {
 public:
 	/**
 	 * Returns true if the end of the stream has been reached.
@@ -290,7 +290,7 @@
  * @todo We really need better error handling here!
  *       Like seek should somehow indicate whether it failed.
  */
-class SeekableReadStream : virtual public ReadStream {
+class BROWSER_API SeekableReadStream : virtual public ReadStream {
 public:
 
 	virtual uint32 pos() const = 0;
@@ -320,7 +320,7 @@
  * Likewise, manipulating two substreams of a parent stream will cause them to
  * step on each others toes.
  */
-class SubReadStream : virtual public ReadStream {
+class BROWSER_API SubReadStream : virtual public ReadStream {
 protected:
 	ReadStream *_parentStream;
 	uint32 _pos;
@@ -345,7 +345,7 @@
  * the range [begin, end).
  * The same caveats apply to SeekableSubReadStream as do to SeekableReadStream.
  */
-class SeekableSubReadStream : public SubReadStream, public SeekableReadStream {
+class BROWSER_API SeekableSubReadStream : public SubReadStream, public SeekableReadStream {
 protected:
 	SeekableReadStream *_parentStream;
 	uint32 _begin;
@@ -362,7 +362,7 @@
  * Simple memory based 'stream', which implements the ReadStream interface for
  * a plain memory block.
  */
-class MemoryReadStream : public SeekableReadStream {
+class BROWSER_API MemoryReadStream : public SeekableReadStream {
 private:
 	const byte * const _ptrOrig;
 	const byte *_ptr;
@@ -406,7 +406,7 @@
  * Simple memory based 'stream', which implements the WriteStream interface for
  * a plain memory block.
  */
-class MemoryWriteStream : public WriteStream {
+class BROWSER_API MemoryWriteStream : public WriteStream {
 private:
 	byte *_ptr;
 	const uint32 _bufSize;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -18,7 +18,7 @@
 // ----------------------------------------------------------------------------
 
 // For compilers that support precompilation, includes wxT("wx.h").
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
 #include "wx2scstream.h"
 
@@ -30,6 +30,8 @@
 
 namespace Browser {
 
+using namespace Core;
+
 // ============================================================================
 // implementation
 // ============================================================================

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/wx2scstream.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -19,7 +19,9 @@
 
 namespace Browser {
 
-class WXDLLIMPEXP_BASE wxScummInputStream : public wxInputStream
+using namespace Core;
+
+class BROWSER_API wxScummInputStream : public wxInputStream
 {
 protected:
 	Common::SeekableReadStream* _stream;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -21,7 +21,7 @@
  */
 
 #include "browser_stdafx.h"
-#include "streams/streams_stdafx.h.h"
+#include "streams/streams_stdafx.h"
 
 #include "streams/xorstream.h"
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browser/streams/xorstream.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -27,7 +27,7 @@
 
 namespace Common {
 
-class XORStream : public SeekableReadStream {
+class BROWSER_API XORStream : public SeekableReadStream {
 protected:
 
 	byte _encbyte;

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -7,7 +7,7 @@
 //
 //---------------------------------------------------------------------------
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 #include "BrowserApp.h"
 //#include "BrowserDlg.h"

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/BrowserApp.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -10,13 +10,11 @@
 #ifndef __BROWSERDLGApp_h__
 #define __BROWSERDLGApp_h__
 
-#include "gui_stdafx.h"
-
 class BrowserDlgApp : public wxApp
 {
-	public:
-		bool OnInit();
-		int OnExit();
+public:
+	bool OnInit();
+	int OnExit();
 };
 
 #endif

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -7,22 +7,14 @@
 //
 //---------------------------------------------------------------------------
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 #include "MainForm.h"
 
 #include <fstream>
 
-#include "ExplorationTree.h"
-#include "oregistry.h"
-#include "ftregistry.h"
-
-#include "safe_static.h"
-
 #include "debugmem.h"
 
-using namespace Browser;
-
 //Do not add custom headers between
 //Header Include Start and Header Include End
 //wxDev-C++ designer will remove them
@@ -46,6 +38,7 @@
 	EVT_MENU(ID_DUMPROOTOBJECTCHAIN, MainForm::OnDumpRootObjectChain)
 	EVT_MENU(ID_DUMPCURRENTOBJECTCHAIN, MainForm::OnDumpCurrentObjectChain)
 	EVT_MENU(ID_ACTIVATENODE, MainForm::OnActivateNode)
+	EVT_MENU(ID_LOADPLUGIN, MainForm::OnLoadPlugin)
 	EVT_MENU(ID_TEST1, MainForm::OnTest1)
 	EVT_MENU(ID_TEST1_CLEANUP, MainForm::OnTest1Cleanup)
 	EVT_MENU(ID_TEST0, MainForm::OnTest0)
@@ -57,28 +50,13 @@
 END_EVENT_TABLE()
 ////Event Table End
 
-wxFrame* getMainForm() {
-	return MainForm::getMainForm();
-}
-
-MainForm* MainForm::_mainForm = NULL;
-/*static*/ MainForm* MainForm::getMainForm() {
-	ASSERT(_mainForm);
-	return _mainForm;
-}
-
 MainForm::MainForm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
 : wxFrame(parent, id, title, position, size, style) {
 	CreateGUIControls();
-	//SetClientSize( wxSize(640, 480) );
-	//GetSizer()->SetMinSize(640, 480);
-	//mainPanel->SetMinSize( wxSize(400, 300) );
-	//mainPanel->SetSize( wxSize(400, 300) );
-	//Layout();
 	WxSplitterWindow1->SetSashGravity(0.3);
 
-	_mainForm = this;
-	ExplorationTree::initialize(browserTree, browserNotebook);
+	InitializeObjects();
+
 	/*_timer = new wxTimer();
 	_timer->SetOwner(this, 5);
 	this->Connect(5, wxEVT_TIMER, wxTimerEventHandler(MainForm::OnTimer));
@@ -88,31 +66,6 @@
 	leak[0] = 'L'; leak[1] = 'E'; leak[2] = 'A'; leak[3] = 'K'; leak[4] = '\0';
 }
 
-void MainForm::ZCleanup() {
-
-	/*_timer->Stop();*/
-	/*delete _timer;*/
-
-	//this->Disconnect(_timer.GetId(), wxEVT_TIMER, wxTimerEventHandler(MainForm::OnTimer));
-	//_timer.SetOwner(NULL);
-
-	InitializedObjects::get()->report();
-
-	ExplorationTree::release();
-	InitializedObjects::get()->report();
-
-	FileTypeRegistry::release();
-	InitializedObjects::get()->report();
-
-	ObjectRegistry::release();
-	InitializedObjects::get()->report();
-
-	InitializedObjects::release();
-
-	set_statics_not_allowed();
-	_mainForm = NULL;
-}
-
 MainForm::~MainForm() {
 }
 
@@ -157,6 +110,7 @@
 	ID_COMMANDS_MENU_Mnu_Obj->Enable(ID_DUMPROOTOBJECTCHAIN,false);
 	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_DUMPCURRENTOBJECTCHAIN, wxT("Dump Current Object Chain"), wxT(""), wxITEM_NORMAL);
 	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_ACTIVATENODE, wxT("Activate Node"), wxT(""), wxITEM_NORMAL);
+	ID_COMMANDS_MENU_Mnu_Obj->Append(ID_LOADPLUGIN, wxT("Load Plugin"), wxT(""), wxITEM_NORMAL);
 	WxMenuBar1->Append(ID_COMMANDS_MENU_Mnu_Obj, wxT("Commands"));
 	
 	wxMenu *ID_TEST_MENU_Mnu_Obj = new wxMenu(0);
@@ -181,7 +135,7 @@
 }
 
 void MainForm::OnClose(wxCloseEvent& event) {
-	ZCleanup();
+	CleanupObjects();
 	Destroy();
 }
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -10,8 +10,6 @@
 #ifndef __MAINFORM_h__
 #define __MAINFORM_h__
 
-#include "gui_stdafx.h"
-
 #include <wx/frame.h>
 
 //Do not add custom headers between 
@@ -31,7 +29,7 @@
 #define MainForm_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxTHICK_FRAME | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX
 ////Dialog Style End
 
-namespace Browser {
+namespace Core {
 class ObjectChain;
 }
 
@@ -40,17 +38,16 @@
 	private:
 		DECLARE_EVENT_TABLE();
 		
-		static MainForm* _mainForm;
-
 	public:
 		MainForm(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Game Resource Browser"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = MainForm_STYLE);
 		virtual ~MainForm();
 		//virtual bool Destroy();
-		void ZCleanup();
+		void InitializeObjects();
+		void CleanupObjects();
+
 		void OnTimer(wxTimerEvent& event);
-		static MainForm* getMainForm();
 
-		void dumpObjectChain(Browser::ObjectChain* ochain);
+		void dumpObjectChain(Core::ObjectChain* ochain);
 		void ExitClick(wxCommandEvent& event);
 		void OnTest1Cleanup(wxCommandEvent& event);
 		void OnTest1(wxCommandEvent& event);
@@ -64,6 +61,7 @@
 		void browserTreeItemExpanded(wxTreeEvent& event);
 	void OnOpen(wxCommandEvent& event);
 		void MainFormIdle(wxIdleEvent& event);
+	void OnLoadPlugin(wxCommandEvent& event);
 		
 	private:
 		//Do not add custom control declarations between
@@ -94,6 +92,7 @@
 			ID_DUMPROOTOBJECTCHAIN = 1026,
 			ID_DUMPCURRENTOBJECTCHAIN = 1028,
 			ID_ACTIVATENODE = 1029,
+			ID_LOADPLUGIN = 1030,
 			ID_TEST_MENU = 1010,
 			ID_TEST1 = 1011,
 			ID_TEST1_CLEANUP = 1012,

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.wxform
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.wxform	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainForm.wxform	2007-07-12 02:53:50 UTC (rev 28036)
@@ -288,7 +288,7 @@
       0608436F6D6D616E647312436172726965642E57785F436865636B6564081643
       6172726965642E57585F4249544D41502E446174610A0C00000007544269746D
       61700000000016436172726965642E57785F46696C65486973746F7279081843
-      6172726965642E5778437573746F6D4D656E754974656D0A7204000011000000
+      6172726965642E5778437573746F6D4D656E754974656D0AD505000011000000
       545778437573746F6D4D656E754974656D5450463018547778437573746F6D4D
       656E754974656D577261707065720011436172726965642E49735375624D656E
       750810436172726965642E4556545F4D656E7506154F6E44756D70526F6F744F
@@ -324,63 +324,74 @@
       785F43617074696F6E060D4163746976617465204E6F64651243617272696564
       2E57785F436865636B65640816436172726965642E57585F4249544D41502E44
       6174610A0C00000007544269746D61700000000016436172726965642E57785F
-      46696C65486973746F7279080000000011000000545778437573746F6D4D656E
-      754974656D5450463018547778437573746F6D4D656E754974656D5772617070
-      65720011436172726965642E49735375624D656E750812436172726965642E57
-      785F456E61626C65640911436172726965642E57785F48696464656E08114361
-      72726965642E57785F49444E616D65060C49445F544553545F4D454E55124361
-      72726965642E57785F494456616C756503F20318436172726965642E57785F4D
-      656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C124361
-      72726965642E57785F43617074696F6E0605546573747312436172726965642E
-      57785F436865636B65640816436172726965642E57585F4249544D41502E4461
-      74610A0C00000007544269746D61700000000016436172726965642E57785F46
-      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
+      46696C65486973746F727908000011000000545778437573746F6D4D656E7549
+      74656D5450463018547778437573746F6D4D656E754974656D57726170706572
+      0011436172726965642E49735375624D656E750810436172726965642E455654
+      5F4D656E75060C4F6E4C6F6164506C7567696E12436172726965642E57785F45
+      6E61626C65640911436172726965642E57785F48696464656E08114361727269
+      65642E57785F49444E616D65060D49445F4C4F4144504C5547494E1243617272
+      6965642E57785F494456616C756503060418436172726965642E57785F4D656E
       754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243617272
-      6965642E57785F43617074696F6E06185465737430202D204E6F205363756D6D
-      20506C7567696E7312436172726965642E57785F436865636B65640816436172
-      726965642E57585F4249544D41502E446174610A0C00000007544269746D6170
-      0000000016436172726965642E57785F46696C65486973746F72790800001100
-      0000545778437573746F6D4D656E754974656D5450463018547778437573746F
-      6D4D656E754974656D577261707065720011436172726965642E49735375624D
-      656E750810436172726965642E4556545F4D656E7506074F6E54657374321243
-      6172726965642E57785F456E61626C65640911436172726965642E57785F4869
-      6464656E0811436172726965642E57785F49444E616D65060849445F54455354
-      3212436172726965642E57785F494456616C756503000418436172726965642E
-      57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D61
-      6C12436172726965642E57785F43617074696F6E061A5465737432202D205769
-      7468205363756D6D20506C7567696E7312436172726965642E57785F43686563
-      6B65640816436172726965642E57585F4249544D41502E446174610A0C000000
-      07544269746D61700000000016436172726965642E57785F46696C6548697374
-      6F72790800000000}
+      6965642E57785F43617074696F6E060B4C6F616420506C7567696E1243617272
+      6965642E57785F436865636B65640816436172726965642E57585F4249544D41
+      502E446174610A0C00000007544269746D61700000000016436172726965642E
+      57785F46696C65486973746F7279080000000011000000545778437573746F6D
+      4D656E754974656D5450463018547778437573746F6D4D656E754974656D5772
+      61707065720011436172726965642E49735375624D656E750812436172726965
+      642E57785F456E61626C65640911436172726965642E57785F48696464656E08
+      11436172726965642E57785F49444E616D65060C49445F544553545F4D454E55
+      12436172726965642E57785F494456616C756503F20318436172726965642E57
+      785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C
+      12436172726965642E57785F43617074696F6E06055465737473124361727269
+      65642E57785F436865636B65640816436172726965642E57585F4249544D4150
+      2E446174610A0C00000007544269746D61700000000016436172726965642E57
+      785F46696C65486973746F72790818436172726965642E5778437573746F6D4D
+      656E754974656D0A9D05000011000000545778437573746F6D4D656E75497465
+      6D5450463018547778437573746F6D4D656E754974656D577261707065720011
+      436172726965642E49735375624D656E750810436172726965642E4556545F4D
+      656E7506074F6E546573743112436172726965642E57785F456E61626C656409
+      11436172726965642E57785F48696464656E0811436172726965642E57785F49
+      444E616D65060849445F544553543112436172726965642E57785F494456616C
+      756503F30318436172726965642E57785F4D656E754974656D5374796C65070F
+      77784D6E7549746D5F4E6F726D616C12436172726965642E57785F4361707469
+      6F6E06185465737431202D204E6F205363756D6D20506C7567696E7312436172
+      726965642E57785F436865636B65640816436172726965642E57585F4249544D
+      41502E446174610A0C00000007544269746D6170000000001643617272696564
+      2E57785F46696C65486973746F727908000011000000545778437573746F6D4D
+      656E754974656D5450463018547778437573746F6D4D656E754974656D577261
+      707065720011436172726965642E49735375624D656E75081043617272696564
+      2E4556545F4D656E75060E4F6E5465737431436C65616E757012436172726965
+      642E57785F456E61626C65640911436172726965642E57785F48696464656E08
+      11436172726965642E57785F49444E616D65061049445F54455354315F434C45
+      414E555012436172726965642E57785F494456616C756503F403184361727269
+      65642E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F
+      726D616C12436172726965642E57785F43617074696F6E060C5465737420436C
+      65616E757012436172726965642E57785F436865636B65640816436172726965
+      642E57585F4249544D41502E446174610A0C00000007544269746D6170000000
+      0016436172726965642E57785F46696C65486973746F72790800001100000054
+      5778437573746F6D4D656E754974656D5450463018547778437573746F6D4D65
+      6E754974656D577261707065720011436172726965642E49735375624D656E75
+      0810436172726965642E4556545F4D656E7506074F6E54657374301243617272
+      6965642E57785F456E61626C65640911436172726965642E57785F4869646465
+      6E0811436172726965642E57785F49444E616D65060849445F54455354301243
+      6172726965642E57785F494456616C756503FE0318436172726965642E57785F
+      4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243
+      6172726965642E57785F43617074696F6E06185465737430202D204E6F205363
+      756D6D20506C7567696E7312436172726965642E57785F436865636B65640816
+      436172726965642E57585F4249544D41502E446174610A0C0000000754426974
+      6D61700000000016436172726965642E57785F46696C65486973746F72790800
+      0011000000545778437573746F6D4D656E754974656D54504630185477784375
+      73746F6D4D656E754974656D577261707065720011436172726965642E497353
+      75624D656E750810436172726965642E4556545F4D656E7506074F6E54657374
+      3212436172726965642E57785F456E61626C65640911436172726965642E5778
+      5F48696464656E0811436172726965642E57785F49444E616D65060849445F54
+      4553543212436172726965642E57785F494456616C7565030004184361727269
+      65642E57785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F
+      726D616C12436172726965642E57785F43617074696F6E061A5465737432202D
+      2057697468205363756D6D20506C7567696E7312436172726965642E57785F43
+      6865636B65640816436172726965642E57585F4249544D41502E446174610A0C
+      00000007544269746D61700000000016436172726965642E57785F46696C6548
+      6973746F72790800000000}
     Wx_HasHistory = False
   end
 end

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainFormCommands.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainFormCommands.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/MainFormCommands.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -7,20 +7,30 @@
 //
 //---------------------------------------------------------------------------
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 #include "MainForm.h"
 #include "ExplorationTree.h"
 #include "VirtualNode.h"
 
+#include "ObjectRegistry.h"
+#include "FileTypeRegistry.h"
+
+#include "PluginUtil.h"
+
+#include "safe_static.h"
+
+
 #include <iostream>
 #include <list>
 
+#include <wx/filesys.h>
 #include <wx/filedlg.h>
 #include <wx/wfstream.h>
 #include <wx/stdpaths.h>
+#include <wx/choicdlg.h>
 
-#include "ochain.h"
+#include "ObjectChain.h"
 
 #include "debugmem.h"
 
@@ -29,41 +39,116 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+void MainForm::InitializeObjects() {
+	PluginUtil::setMainForm(this);
+	ExplorationTree::initialize(browserTree, browserNotebook);
+	FileTypeRegistry::get()->registerPlugins();
+}
+
+void MainForm::CleanupObjects() {
+
+	/*_timer->Stop();*/
+	/*delete _timer;*/
+
+	//this->Disconnect(_timer.GetId(), wxEVT_TIMER, wxTimerEventHandler(MainForm::OnTimer));
+	//_timer.SetOwner(NULL);
+
+	InitializedObjects::get()->report();
+
+	ExplorationTree::release();
+	InitializedObjects::get()->report();
+
+	FileTypeRegistry::release();
+	InitializedObjects::get()->report();
+
+	ObjectRegistry::release();
+	InitializedObjects::get()->report();
+
+	InitializedObjects::release();
+
+	PluginUtil::unloadAllPlugins();
+
+	PluginUtil::setMainForm(NULL);
+	set_statics_not_allowed();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
 typedef std::list< std::pair<wxString, wxString> > plugins_list;
 plugins_list getAvailablePlugins() {
 	plugins_list plugins;
 
 	wxFileSystem fs;
-	fs.ChangePathTo(getPluginsDir(), true);
+	fs.ChangePathTo(PluginUtil::getPluginsDir(), true);
 
 	wxString found = fs.FindFirst(wxT("*"), wxFILE);
 	while (!found.IsEmpty()) {
 		wxFileName fname(found);
 		wxString dispName = fname.GetFullName();
-		plugins.push_back(make_pair(dispName, fname.GetFullPath()));
+		plugins.push_back(plugins_list::value_type(dispName, fname.GetFullPath()));
 		found = fs.FindNext();
 	}
 
 	return plugins;
 }
 
-/////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////
+wxString askForAPlugin() {
+	plugins_list plugins(getAvailablePlugins());
 
-#ifdef UNIX
-	#include <dlfcn.h>
-#endif
+	wxString* names = new wxString[plugins.size()];
+	wxString** paths = new wxString*[plugins.size()];
 
-bool loadPlugin(wxString nativePath) {
-	infoout << wxT("Registering plugin: ") << nativePath << std::endl;
-	LoadLibrary
-	ObjectRegistry::get()->registerPlugin( &getTest2Plugin, false );
+	plugins_list::iterator i;
+	int idx = 0;
+	for (i = plugins.begin(); i != plugins.end(); ++i, ++idx) {
+		names[idx] = i->first;
+		paths[idx] = &i->second;
+	}
+
+	wxSingleChoiceDialog *dialog = new wxSingleChoiceDialog(PluginUtil::getMainForm(),
+		wxT("Please select a plugin to load"), wxT("Plugin selection"), plugins.size(),
+		names, (char**)paths, wxOK|wxCANCEL|wxCENTRE, wxDefaultPosition);
+	int res = dialog->ShowModal();
+
+	wxString path;
+	if (res == wxID_OK) {
+		path = *(wxString*)dialog->GetSelectionClientData();
+	}
+	dialog->Destroy();
+
+	delete [] names;
+	delete [] paths;
+
+	return path;
 }
 
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
+
 /*
+* OnLoadPlugin
+*/
+void MainForm::OnLoadPlugin(wxCommandEvent& event)
+{
+	wxString plugin = askForAPlugin();
+	if (plugin.IsEmpty())
+		return;
+
+	bool res = PluginUtil::loadPlugin(plugin);
+	if (res) {
+		wxMessageBox(wxString(wxT("Plugin Loaded: ")) + plugin,
+		wxT("Loading Plugin"), wxOK | wxICON_INFORMATION, this);
+
+		FileTypeRegistry::get()->registerPlugins();
+	}
+	else
+		wxMessageBox(wxString(wxT("Plugin Loading Failed: ")) + plugin,
+		wxT("Loading Plugin"), wxOK | wxICON_ERROR, this);
+}
+
+/*
  * browserTreeItemActivated
  */
 void MainForm::browserTreeItemActivated(wxTreeEvent& event) {

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test1.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test1.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test1.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -7,7 +7,7 @@
 //
 //---------------------------------------------------------------------------
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 #include "MainForm.h"
 
@@ -18,19 +18,23 @@
 #include <fstream>
 
 #include "plugin.h"
-#include "oregistry.h"
+#include "ObjectRegistry.h"
+#include "FileTypeRegistry.h"
+#include "ObjectChain.h"
 
+#include "PluginUtil.h"
+
 #include "ExplorationTree.h"
 #include "VirtualNode.h"
 
 #include "Directories.h"
-#include "DirectoryPresenter.h"
-#include "BMPParser.h"
-#include "ImagePresenter.h"
-#include "FileInfoPresenter.h"
+//#include "DirectoryPresenter.h"
+//#include "BMPParser.h"
+//#include "ImagePresenter.h"
+//#include "FileInfoPresenter.h"
 #include "PanelProvider.h"
 #include "FileTypeRecognizer.h"
-#include "TextPresenter.h"
+//#include "TextPresenter.h"
 
 #include "debugmem.h"
 
@@ -39,13 +43,14 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-PLUGIN_DESC_EX(Test1Plugin, wxT("MyPlugins"), 1)
+#define EMPTY_TOKEN
+PLUGIN_DESC_EX(Test1Plugin, wxT("MyPlugins"), 1, EMPTY_TOKEN)
 	//PLUGGED_OBJECT(RootDirectory)
-	PLUGGED_OBJECT(DirectoryPresenter)
-	PLUGGED_OBJECT(BMPParser)
-	PLUGGED_OBJECT(ImagePresenter)
-	PLUGGED_OBJECT(TextPresenter)
-	PLUGGED_OBJECT(FileInfoPresenter)
+	//PLUGGED_OBJECT(DirectoryPresenter)
+	//PLUGGED_OBJECT(BMPParser)
+	//PLUGGED_OBJECT(ImagePresenter)
+	//PLUGGED_OBJECT(TextPresenter)
+	//PLUGGED_OBJECT(FileInfoPresenter)
 	PLUGGED_OBJECT(PanelProvider)
 
 	PLUGGED_OBJECT(BinaryFileTypeRecognizer)
@@ -57,14 +62,13 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-wxString getResourcePath(const wxString& resourceName);
-
 void MainForm::OnTest0(wxCommandEvent& event) {
 
 	OnTest1Cleanup(event);
 
 	infoout << wxT("Registering Test1 Plugin.") << std::endl;
 	ObjectRegistry::get()->registerPlugin( &getTest1Plugin, false );
+	FileTypeRegistry::get()->registerPlugins();
 
 	wxTreeItemId rootItem = ExplorationTree::get()->addRoot(wxT("RootDirectory"));
 
@@ -76,7 +80,7 @@
 
 	rootChain->addObject(rootDir);
 
-	wxString dataDir = getResourcePath(wxT("data"));
+	wxString dataDir = PluginUtil::getResourcePath(wxT("data"));
 	wxFileName dataFN(dataDir, wxEmptyString);
 
 	wxFileName doll(dataDir, wxT("lalka.bmp"));
@@ -104,6 +108,7 @@
 	
 	infoout << wxT("Registering Test1 Plugin.") << std::endl;
 	ObjectRegistry::get()->registerPlugin( &getTest1Plugin, false );
+	FileTypeRegistry::get()->registerPlugins();
 	
 	wxTreeItemId rootItem = ExplorationTree::get()->addRoot(wxT("RootDirectory"));
 
@@ -115,7 +120,7 @@
 
 	rootChain->addObject(rootDir);
 
-	wxString dataDir = getResourcePath(wxT("data"));
+	wxString dataDir = PluginUtil::getResourcePath(wxT("data"));
 	wxFileName dataFN(dataDir, wxEmptyString);
 
 	wxFileName doll(dataDir, wxT("lalka.bmp"));

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test2.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test2.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/Test2.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -7,10 +7,9 @@
 //
 //---------------------------------------------------------------------------
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 #include "MainForm.h"
-wxString getResourcePath(const wxString& resourceName);
 
 #include <wx/filename.h>
 
@@ -18,28 +17,32 @@
 #include <fstream>
 
 #include "plugin.h"
-#include "oregistry.h"
+#include "ObjectRegistry.h"
+#include "FileTypeRegistry.h"
 
+#include "PluginUtil.h"
+
+#include "ObjectChain.h"
+
 #include "ExplorationTree.h"
 #include "VirtualNode.h"
 
 #include "Directories.h"
-#include "DirectoryPresenter.h"
-#include "BMPParser.h"
-#include "ImagePresenter.h"
-#include "FileInfoPresenter.h"
+//#include "DirectoryPresenter.h"
+//#include "BMPParser.h"
+//#include "ImagePresenter.h"
+//#include "FileInfoPresenter.h"
 #include "PanelProvider.h"
 #include "FileTypeRecognizer.h"
-#include "TextPresenter.h"
-#include "HtmlPresenter.h"
+//#include "TextPresenter.h"
+//#include "HtmlPresenter.h"
 
-#include "scumm/ScummRecognizer.h"
+//#include "scumm/ScummRecognizer.h"
+//#include "scumm/ScummParser.h"
+//#include "scumm/ScummBlockPresenter.h"
+//#include "scumm/ScummBlockInfoPresenter.h"
+//#include "scumm/BlockyBlockPresenter.h"
 
-#include "scumm/ScummParser.h"
-#include "scumm/ScummBlockPresenter.h"
-#include "scumm/ScummBlockInfoPresenter.h"
-#include "scumm/BlockyBlockPresenter.h"
-
 #include "debugmem.h"
 
 using namespace Browser;
@@ -47,18 +50,19 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 
-PLUGIN_DESC_EX(Test2Plugin, wxT("MyPlugins"), 1)
+#define EMPTY_TOKEN
+PLUGIN_DESC_EX(Test2Plugin, wxT("MyPlugins"), 1, EMPTY_TOKEN)
 	//PLUGGED_OBJECT(RootDirectory)
-	PLUGGED_OBJECT(DirectoryPresenter)
-	PLUGGED_OBJECT(ImagePresenter)
-	PLUGGED_OBJECT(TextPresenter)
-	PLUGGED_OBJECT(HtmlPresenter)
-	PLUGGED_OBJECT(FileInfoPresenter)
+	//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(BinaryParser)
+	//PLUGGED_OBJECT(BMPParser)
 
 	PLUGGED_OBJECT(BinaryFileTypeRecognizer)
 	PLUGGED_OBJECT(BinaryFileTypeParserResolver)
@@ -67,22 +71,22 @@
 	PLUGGED_OBJECT(TextFileTypeRecognizer)
 	PLUGGED_OBJECT(TextFileTypeParserResolver)
 
-	PLUGGED_OBJECT(ScummFileTypeRecognizer)
-	PLUGGED_OBJECT(ScummFileTypeParserResolver)
+	//PLUGGED_OBJECT(ScummFileTypeRecognizer)
+	//PLUGGED_OBJECT(ScummFileTypeParserResolver)
 
-	PLUGGED_OBJECT(ScummParser)
-	PLUGGED_OBJECT(ScummBlockPresenter)
-	PLUGGED_OBJECT(ScummBlockInfoPresenter)
-	PLUGGED_OBJECT(BlockyBlockPresenter)
+	//PLUGGED_OBJECT(ScummParser)
+	//PLUGGED_OBJECT(ScummBlockPresenter)
+	//PLUGGED_OBJECT(ScummBlockInfoPresenter)
+	//PLUGGED_OBJECT(BlockyBlockPresenter)
 
-	PLUGGED_OBJECT(ScummLOFFBlockPresenter)	
-	PLUGGED_OBJECT(ScummOFFSBlockPresenter)	
-	PLUGGED_OBJECT(ScummRMHDBlockPresenter)	
-	PLUGGED_OBJECT(ScummTRNSBlockPresenter)	
-	PLUGGED_OBJECT(ScummPALBlockPresenter)	
-	PLUGGED_OBJECT(ScummIMGBlockPresenter)	
+	//PLUGGED_OBJECT(ScummLOFFBlockPresenter)	
+	//PLUGGED_OBJECT(ScummOFFSBlockPresenter)	
+	//PLUGGED_OBJECT(ScummRMHDBlockPresenter)	
+	//PLUGGED_OBJECT(ScummTRNSBlockPresenter)	
+	//PLUGGED_OBJECT(ScummPALBlockPresenter)	
+	//PLUGGED_OBJECT(ScummIMGBlockPresenter)	
 
-	PLUGGED_OBJECT(ScummScriptBlockPresenter)	
+	//PLUGGED_OBJECT(ScummScriptBlockPresenter)	
 
 PLUGIN_END
 
@@ -95,6 +99,7 @@
 	
 	infoout << wxT("Registering Test2 Plugin.") << std::endl;
 	ObjectRegistry::get()->registerPlugin( &getTest2Plugin, false );
+	FileTypeRegistry::get()->registerPlugins();
 	
 	wxTreeItemId rootItem = ExplorationTree::get()->addRoot(wxT("RootDirectory"));
 
@@ -106,7 +111,7 @@
 
 	rootChain->addObject(rootDir);
 
-	wxString dataDir = getResourcePath(wxT("data"));
+	wxString dataDir = PluginUtil::getResourcePath(wxT("data"));
 	wxFileName dataFN(dataDir, wxEmptyString);
 
 	if (dataFN.IsOk() && dataFN.DirExists() && dataFN.IsDirReadable())
@@ -154,6 +159,7 @@
 
 	infoout << wxT("Registering Test2 Plugin.") << std::endl;
 	ObjectRegistry::get()->registerPlugin( &getTest2Plugin, false );
+	FileTypeRegistry::get()->registerPlugins();
 
 	wxTreeItemId rootItem = ExplorationTree::get()->addRoot(wxT("RootDirectory"));
 

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.cpp	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.cpp	2007-07-12 02:53:50 UTC (rev 28036)
@@ -17,7 +17,7 @@
 * This will produce a big PCH file.
 */
 
-#include "gui_stdafx.h"
+#include "browserapp_stdafx.h"
 
 //#ifdef __WXMSW__
 //#include "wx/msw/msvcrt.h"

Modified: scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.h	2007-07-11 16:55:46 UTC (rev 28035)
+++ scummex/branches/gsoc2007-gameresbrowser/src/browserapp/browserapp_stdafx.h	2007-07-12 02:53:50 UTC (rev 28036)
@@ -3,11 +3,19 @@
 // are changed infrequently
 //
 
-#ifndef _GUI_STDAFX_H_
-#define _GUI_STDAFX_H_
+#ifndef _BROWSERAPP_STDAFX_H_
+#define _BROWSERAPP_STDAFX_H_
 
-#include "plugins_stdafx.h"
+#include "browser_stdafx.h"
 
-// TODO: reference additional headers your program requires here
+/*
+When getting error like this:
+CVTRES : fatal error CVT1100: duplicate resource.  type:MANIFEST, name:1, language:0x0409

@@ Diff output truncated at 100000 characters. @@

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




More information about the Scummvm-git-logs mailing list