[Scummvm-cvs-logs] SF.net SVN: scummvm: [27847] scummex/branches/gsoc2007-gameresbrowser
zbychs at users.sourceforge.net
zbychs at users.sourceforge.net
Mon Jul 2 03:45:25 CEST 2007
Revision: 27847
http://scummvm.svn.sourceforge.net/scummvm/?rev=27847&view=rev
Author: zbychs
Date: 2007-07-01 18:45:25 -0700 (Sun, 01 Jul 2007)
Log Message:
-----------
First version of ExplorationTree. Lots of background work.
Modified Paths:
--------------
scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h
scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.h
scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h
scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h
scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h
scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h
scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform
scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.h
scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h
scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp
scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj
scummex/branches/gsoc2007-gameresbrowser/vc8/core/ReadMe.txt
scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout
Added Paths:
-----------
scummex/branches/gsoc2007-gameresbrowser/src/data/lisy.bmp
scummex/branches/gsoc2007-gameresbrowser/src/data/pies.bmp
scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -7,10 +7,12 @@
#include "stdafx.h"
#include "ochain.h"
+#include "oregistry.h"
#include "treealgos.h"
#include <functional>
+#include <iostream>
#include "debugmem.h"
@@ -23,269 +25,375 @@
//ObjectChain holds BObjects and connections between them.
- //returns true if the insertion was made
- //returns false on failure or if the object was already there
- bool ObjectChain::addObject(const RCPtr<BObject>& obj) {
- std::pair<object_set::iterator, bool> res =
- objects.insert(obj);
- if(!res.second) //the object was already there
- return false;
- bool ok = obj->realize(this);
- if(ok) //the object initialized properly
- return true;
- objects.erase(obj);
+//returns true if the insertion was made
+//returns false if the object was already there
+bool ObjectChain::addObject(const RCPtr<BObject>& obj) {
+ std::pair<object_set::iterator, bool> res =
+ objects.insert(obj);
+ if(!res.second) //the object was already there
return false;
- }
+ return true;
+}
- bool ObjectChain::isContained(const RCPtr<BObject>& obj) {
- return objects.count(obj) == 1;
- }
+bool ObjectChain::isContained(const RCPtr<BObject>& obj) {
+ return objects.count(obj) == 1;
+}
- //returns true if connected
- //false in case of error or if already was connected
- bool ObjectChain::connect(const RCPtr<BObject>& obj0,
+//returns true if connected
+//false in case of error or if already was connected
+bool ObjectChain::connect(const RCPtr<BObject>& obj0,
+ const RCPtr<BObject>& obj1,
+ const BGUID& interfaceGUID) {
+ ASSERT( objects.count(obj0) == 1 ); // must be our object
+ ASSERT( objects.count(obj1) == 1 ); // must be our object
+
+ PinType* pin = obj0->get_pin(interfaceGUID);
+ SlotType* slot = obj1->get_slot(interfaceGUID);
+ if(!pin || !slot)
+ return false;
+
+ if(slot->isConnected())
+ return false;
+ //the slot is not conected *anywhere*, so it's not in our maps either
+
+ bool cycles = check_for_cycles(obj0,obj1);
+ if(cycles)
+ return false;
+
+ slot2pin.insert( slot2pin_pair(slot, pin) );
+ pin2slot.insert( pin2slot_pair(pin, slot) );
+ pin2that.insert( pin2that_pair(pin, obj0.get()) );
+ slot->connect(pin);
+
+ return true;
+}
+
+bool ObjectChain::isConnected(const RCPtr<BObject>& obj0,
const RCPtr<BObject>& obj1,
const BGUID& interfaceGUID) {
- ASSERT( objects.count(obj0) == 1 ); // must be our object
- ASSERT( objects.count(obj1) == 1 ); // must be our object
+ ASSERT( objects.count(obj0) == 1 ); // must be our object
+ ASSERT( objects.count(obj1) == 1 ); // must be our object
- PinType* pin = obj0->get_pin(interfaceGUID);
- SlotType* slot = obj1->get_slot(interfaceGUID);
- if(!pin || !slot)
- return false;
+ PinType* pin = obj0->get_pin(interfaceGUID);
+ SlotType* slot = obj1->get_slot(interfaceGUID);
+ if(!pin || !slot)
+ return false;
- if(slot->isConnected())
- return false;
- //the slot is not conected *anywhere*, so it's not in our maps either
+ if(slot->isConnected())
+ return false;
+ //the slot is not conected *anywhere*, so it's not in our maps either
- bool cycles = check_for_cycles(obj0,obj1);
- if(cycles)
- return false;
+ slot2pin_map::iterator i = slot2pin.find(slot);
+ if(i == slot2pin.end())
+ return false;
- slot2pin.insert( slot2pin_pair(slot, pin) );
- pin2slot.insert( pin2slot_pair(pin, slot) );
- pin2that.insert( pin2that_pair(pin, obj0.get()) );
- slot->connect(pin);
-
- return true;
- }
+ if(i->second != pin)
+ return false;
- bool ObjectChain::isConnected(const RCPtr<BObject>& obj0,
- const RCPtr<BObject>& obj1,
+ //ASSERT(slot->getPin() == pin);
+
+ return true;
+}
+
+//returns true if it has been disconnected
+//returns false in case of error or if already was not connected
+bool ObjectChain::disconnect(const RCPtr<BObject>& obj0,
+ const RCPtr<BObject>& obj1,
+ const BGUID& interfaceGUID) {
+ PinType* pin = obj0->get_pin(interfaceGUID);
+ SlotType* slot = obj1->get_slot(interfaceGUID);
+ return _disconnect(pin, slot);
+}
+
+//returns true if it has been disconnected
+//returns false on error or if already was not connected
+bool ObjectChain::disconnect_slot(const RCPtr<BObject>& obj,
const BGUID& interfaceGUID) {
- ASSERT( objects.count(obj0) == 1 ); // must be our object
- ASSERT( objects.count(obj1) == 1 ); // must be our object
+ SlotType* slot = obj->get_slot(interfaceGUID);
+ return disconnect_slot(slot);
+}
- PinType* pin = obj0->get_pin(interfaceGUID);
- SlotType* slot = obj1->get_slot(interfaceGUID);
- if(!pin || !slot)
- return false;
+//returns true if it has been disconnected
+//returns false on error or if already was not connected
+bool ObjectChain::disconnect_slot(SlotType* slot) {
+ PinType* pin = _match_pin(slot);
- if(slot->isConnected())
- return false;
- //the slot is not conected *anywhere*, so it's not in our maps either
+ return _disconnect(pin, slot);
+}
- slot2pin_map::iterator i = slot2pin.find(slot);
- if(i == slot2pin.end())
- return false;
+//returns true if all the slots has been succesfully disconnected
+//returns false on error
+bool ObjectChain::disconnect_pin(const RCPtr<BObject>& obj,
+ const BGUID& interfaceGUID) {
+ PinType* pin = obj->get_pin(interfaceGUID);
+ return disconnect_pin(pin);
+}
- if(i->second != pin)
- return false;
+//returns true if all the slots has been succesfully disconnected
+//returns false on error
+bool ObjectChain::disconnect_pin(PinType* pin) {
+ if(!pin)
+ return false;
+ bool res = true;
+ pin2slot_map::iterator i;
+ i = pin2slot.find(pin);
- //ASSERT(slot->getPin() == pin);
+ std::vector<SlotType*> slots; //cache slots, cause _disconnect messes with pin2slot
+ for(; i != pin2slot.end() && i->first == pin; ++i)
+ slots.push_back( i->second );
- return true;
- }
+ std::vector<SlotType*>::iterator j;
+ for(j = slots.begin(); j != slots.end(); ++j)
+ res &= _disconnect(pin, *j);
- //returns true if it has been disconnected
- //returns false in case of error or if already was not connected
- bool ObjectChain::disconnect(const RCPtr<BObject>& obj0,
- const RCPtr<BObject>& obj1,
- const BGUID& interfaceGUID) {
- PinType* pin = obj0->get_pin(interfaceGUID);
- SlotType* slot = obj1->get_slot(interfaceGUID);
- return _disconnect(pin, slot);
- }
+ return res;
+}
- //returns true if it has been disconnected
- //returns false on error or if already was not connected
- bool ObjectChain::disconnect_slot(const RCPtr<BObject>& obj,
- const BGUID& interfaceGUID) {
- SlotType* slot = obj->get_slot(interfaceGUID);
- return disconnect_slot(slot);
- }
+void ObjectChain::disconnectObject(const RCPtr<BObject>& obj) {
+ ASSERT( objects.count(obj) == 1 ); // must be our object
- //returns true if it has been disconnected
- //returns false on error or if already was not connected
- bool ObjectChain::disconnect_slot(SlotType* slot) {
- PinType* pin = _match_pin(slot);
+ bool res = true;
- return _disconnect(pin, slot);
+ //iterate over pins and slots and disconnect them:
+ //(careful not to disconnect pins/slots that are connected in some other
+ //ObjectChain)
+ PinSlotDescs::const_iterator i;
+ const PinSlotDescs& pins = obj->get_pins();
+ for (i = pins.begin(); i != pins.end(); ++i)
+ {
+ PinSlotDesc* desc = i->second;
+ PinType* pin = desc->get_pin(obj.get());
+ res &= disconnect_pin(pin);
}
- //returns true if all the slots has been succesfully disconnected
- //returns false on error
- bool ObjectChain::disconnect_pin(const RCPtr<BObject>& obj,
- const BGUID& interfaceGUID) {
- PinType* pin = obj->get_pin(interfaceGUID);
- return disconnect_pin(pin);
+ const PinSlotDescs& slots = obj->get_slots();
+ for (i = slots.begin(); i != slots.end(); ++i)
+ {
+ PinSlotDesc* desc = i->second;
+ SlotType* slot = desc->get_slot(obj.get());
+ res &= disconnect_slot(slot);
}
- //returns true if all the slots has been succesfully disconnected
- //returns false on error
- bool ObjectChain::disconnect_pin(PinType* pin) {
- if(!pin)
- return false;
- bool res = true;
- pin2slot_map::iterator i;
- i = pin2slot.find(pin);
+ //return res; - nonsense - it will say false if *any* of the pins/slots was not connected
+}
- std::vector<SlotType*> slots; //cache slots, cause _disconnect messes with pin2slot
- for(; i != pin2slot.end() && i->first == pin; ++i)
- slots.push_back( i->second );
+void ObjectChain::removeObject(const RCPtr<BObject>& obj) {
+ ASSERT( objects.count(obj) == 1 ); // must be our object
+ obj->unrealize(this);
+ disconnectObject(obj);
+ objects.erase(obj); //the ref count just went down
+}
- std::vector<SlotType*>::iterator j;
- for(j = slots.begin(); j != slots.end(); ++j)
- res &= _disconnect(pin, *j);
+bool ObjectChain::realize() {
+ ordered_objs objs;
+ order_back_to_front(objs);
+ ordered_objs::const_reverse_iterator i;
- return res;
+ bool res = true;
+ for (i = objs.rbegin(); i != objs.rend(); ++i) {
+ res &= (*i)->realize(this);
}
- void ObjectChain::disconnectObject(const RCPtr<BObject>& obj) {
- ASSERT( objects.count(obj) == 1 ); // must be our object
+ if(!res)
+ unrealize();
- bool res = true;
+ return res;
+}
- //iterate over pins and slots and disconnect them:
- //(careful not to disconnect pins/slots that are connected in some other
- //ObjectChain)
- PinSlotDescs::const_iterator i;
- const PinSlotDescs& pins = obj->get_pins();
- for(i = pins.begin(); i != pins.end(); ++i)
- {
- PinSlotDesc* desc = i->second;
- PinType* pin = desc->get_pin(obj.get());
- res &= disconnect_pin(pin);
- }
- const PinSlotDescs& slots = obj->get_slots();
- for(i = slots.begin(); i != slots.end(); ++i)
- {
- PinSlotDesc* desc = i->second;
- SlotType* slot = desc->get_slot(obj.get());
- res &= disconnect_slot(slot);
- }
+void ObjectChain::unrealize() {
+ ordered_objs objs;
+ order_back_to_front(objs);
+ ordered_objs::const_iterator i;
+ for (i = objs.begin(); i != objs.end(); ++i) {
+ (*i)->unrealize(this);
+ }
+}
- //return res; - nonsense - it will say false if *any* of the pins/slots was not connected
+void ObjectChain::disconnectAll() {
+ object_set::const_iterator i;
+ for (i = objects.begin(); i != objects.end(); ++i) {
+ disconnectObject(*i);
}
+}
- void ObjectChain::removeObject(const RCPtr<BObject>& obj) {
- ASSERT( objects.count(obj) == 1 ); // must be our object
- obj->unrealize(this);
- disconnectObject(obj);
- objects.erase(obj); //the ref count just went down
+void ObjectChain::removeAllObjects() {
+ ordered_objs objs;
+ order_back_to_front(objs);
+ ordered_objs::const_iterator i;
+ for (i = objs.begin(); i != objs.end(); ++i) {
+ removeObject(*i);
}
+}
- //TODO: make it in order
- void ObjectChain::disconnectAll() {
- object_set::const_iterator i;
- for(i = objects.begin(); i != objects.end(); ++i) {
- (*i)->unrealize(this);
- disconnectObject(*i);
+ObjectChain::~ObjectChain() {
+ removeAllObjects();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PinSlotDesc* ObjectChain::_get_not_connected(BObject* obj, bool ifPin) {
+
+ PinSlotDescs::const_iterator i;
+ const PinSlotDescs& descs = ifPin ? obj->get_pins() : obj->get_slots();
+ for (i = descs.begin(); i != descs.end(); ++i)
+ {
+ PinSlotDesc* desc = i->second;
+ if (ifPin && (desc->flags & PIN_DEFAULT) ) {
+ pin2slot_map::iterator i;
+ PinType* pin = desc->get_pin(obj);
+ i = pin2slot.find(pin);
+ if (i == pin2slot.end())
+ return desc; //not connected default pin
}
+
+ if (!ifPin && (desc->flags & SLOT_DEFAULT) ) {
+ pin2slot_map::iterator i;
+ SlotType* slot = desc->get_slot(obj);
+ PinType* pin = _match_pin(slot);
+ if (pin == NULL)
+ return desc; //not connected default slot
+ }
}
- void ObjectChain::removeAllObjects() {
- disconnectAll();
- objects.clear(); //all the ref counts down
+ return NULL;
+}
+
+//FIXME: implement whole completion logic
+void ObjectChain::complete() {
+ PinSlotDesc* desc;
+ ordered_objs objs;
+ ordered_objs::const_reverse_iterator i;
+
+ std::cout << "--- ObjectChain::complete() ---" << std::endl;
+ std::cout << "--- PINS ---" << std::endl;
+
+ //connecting pins with new objects
+next_pin:
+ order_back_to_front(objs);
+ for (i = objs.rbegin(); i != objs.rend(); ++i) {
+ desc = _get_not_connected(*i, true);
+
+ if (!desc)
+ continue; //every pin is connected
+
+ RCPtr<BObject> obj = ObjectRegistry::get()->getObjectWithSlot(desc->interfaceGUID);
+ if (obj.get() == NULL)
+ continue; //no object with desired slot
+
+ this->addObject(obj);
+ bool res = connect(RCPtr<BObject>(*i), obj, desc->interfaceGUID);
+ if (res) {
+ std::cout << " CONNECTED: " << (*i)->get_GUID().identifier
+ << " --> " << desc->interfaceGUID.identifier
+ << " --> " << obj->get_GUID().identifier << std::endl;
+ goto next_pin; //connected
+ } else {
+ std::cout << " CYCLE?: " << (*i)->get_GUID().identifier
+ << " --> " << desc->interfaceGUID.identifier
+ << " --> " << obj->get_GUID().identifier << std::endl;
+ }
+
+ this->removeObject(obj);
}
- ObjectChain::~ObjectChain() {
- removeAllObjects();
+ std::cout << "--- SLOTS ---" << std::endl;
+
+ //connecting slots with existing objects
+next_slot:
+ order_back_to_front(objs);
+ for (i = objs.rbegin(); i != objs.rend(); ++i) {
+ BObject* obj0 = *i;
+ desc = _get_not_connected(obj0, false);
+
+ if (!desc)
+ continue; //every slot is connected
+
+ ordered_objs::const_reverse_iterator j;
+ for (j = objs.rbegin(); j != objs.rend(); ++j) {
+ BObject* obj1 = *j;
+ if(obj1 == obj0)
+ continue;
+
+ PinType* pin = obj1->get_pin(desc->interfaceGUID);
+ if (!pin)
+ continue; //no apropraiate pin
+
+ bool res = connect(RCPtr<BObject>(obj1),RCPtr<BObject>(obj0),desc->interfaceGUID);
+ if (res) {
+ std::cout << " CONNECTED: " << obj1->get_GUID().identifier
+ << " --> " << desc->interfaceGUID.identifier
+ << " --> " << obj0->get_GUID().identifier << std::endl;
+ goto next_slot; //connected
+ } else {
+ std::cout << " CYCLE?: " << obj1->get_GUID().identifier
+ << " --> " << desc->interfaceGUID.identifier
+ << " --> " << obj0->get_GUID().identifier << std::endl;
+ }
+ }
}
+ std::cout << "--- DONE ---" << std::endl;
+}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// private:
- typedef tree_algos::bfs_fringe<BObject*> bfsFringe;
- struct Expand : std::binary_function<BObject*,bfsFringe,void> {
- ObjectChain* that;
- Expand(ObjectChain* _that) : that(_that) {}
- void operator()(BObject* obj, bfsFringe fringe) {
- _expand_node(that, obj, fringe);
- }
- };
+typedef tree_algos::bfs_fringe<BObject*> bfsFringe;
- //expand: for every slot in node add connected pin's owner
- template<template<typename T> class Fringe>
- void _expand_node(ObjectChain* ochain, BObject* obj, Fringe<BObject*> fringe) {
+//functor for expanding the node in bfs traversal of the DAG
+struct ocExpand {
+ ObjectChain* _that;
+ ocExpand(ObjectChain* that) : _that(that) {}
+ void operator()(BObject* obj, int level, bfsFringe& fringe) {
//this implementation is stupid and allow duplicates to end up in
//the fringe - there won't be infinite recursion though
const PinSlotDescs& slots = obj->get_slots();
PinSlotDescs::const_iterator i;
- for(i = slots.begin(); i != slots.end(); ++i)
- {
+ for (i = slots.begin(); i != slots.end(); ++i) {
PinSlotDesc* desc = i->second;
SlotType* slot = desc->get_slot(obj);
- PinType* pin = ochain->_match_pin(slot);
+ PinType* pin = _that->_match_pin(slot);
if(!pin)
continue;
- BObject* other = ochain->_match_that(pin);
+ BObject* other = _that->_match_that(pin);
ASSERT(other);
- fringe.push(other);
+ fringe.push(other, level+1);
}
}
+};
- //visit: return true if node == obj1
- int _visit_node(BObject* refobj, BObject* obj) {
- return (refobj == obj) ? tree_algos::DONE : tree_algos::CONTINUE;
- }
+//functor for computing ranks of the nodes in the DAG
+struct ocVisitRanks {
+ typedef std::map<BObject*, int> rank_map;
+ rank_map _ranks;
- //Order objects in "destruction" order
- //it stores the result in objs
- void ObjectChain::order_back_to_front(ordered_objs& objs) {
+ ObjectChain* _that;
- //for each object in the list, bfs:
- //initial node: the object
- //expand: for every slot in node add connected pin's owner
- //visit: raise the objects rank
-
- typedef std::map<BObject*, int> rank_map;
- rank_map ranks;
- object_set::const_iterator i;
- for(i = objects.begin(); i != objects.end(); ++i)
- ranks.insert( std::make_pair(i->get(), 0) );
+ ocVisitRanks(ObjectChain* that) : _that(that) {
+ ObjectChain::object_set::const_iterator i;
+ for (i = _that->objects.begin(); i != _that->objects.end(); ++i)
+ _ranks.insert( std::make_pair(i->get(), 0) );
+ }
- struct Visit : std::unary_function<BObject*,bool> {
- rank_map& ranks;
- int cur_rank;
- Visit(rank_map& _ranks) : ranks(_ranks), cur_rank(0) {}
- int operator()(BObject* obj) {
- rank_map::iterator i;
- i = ranks.find(obj);
- ASSERT( i != ranks.end() );
- int rank = i->second;
- if(rank > cur_rank)
- return tree_algos::SKIP;
- i->second = cur_rank;
- cur_rank++;
- return tree_algos::CONTINUE;
- }
- };
- Visit visit(ranks);
- Expand expand(this);
- for(i = objects.begin(); i != objects.end(); ++i)
- {
- visit.cur_rank = 0;
- tree_algos::bfs(i->get(),visit,expand);
- }
+ int operator()(BObject* obj, int level) {
+ rank_map::iterator i;
+ i = _ranks.find(obj);
+ ASSERT( i != _ranks.end() );
+ int rank = i->second;
+ if(rank > level)
+ return tree_algos::SKIP;
+ i->second = level;
+ return tree_algos::CONTINUE;
+ }
+ void returnOrdered(ObjectChain::ordered_objs& objs) {
//sort
typedef std::pair<BObject*, int> the_pair;
typedef std::vector<the_pair> unrank_vec;
- unrank_vec unranks( ranks.begin(), ranks.end() );
+ unrank_vec unranks( _ranks.begin(), _ranks.end() );
struct Util {
bool operator()(const the_pair& p0, const the_pair& p1) {
return p0.second < p1.second;
@@ -298,93 +406,120 @@
objs.resize(unranks.size());
std::transform(unranks.begin(), unranks.end(), objs.begin(), Util());
}
+};
- //Check for cycles created by edge obj0.pin <- obj1.slot
- bool ObjectChain::check_for_cycles(const RCPtr<BObject>& obj0,
- const RCPtr<BObject>& obj1) {
- ASSERT( objects.count(obj0) == 1 ); // must be our object
- ASSERT( objects.count(obj1) == 1 ); // must be our object
+//functor for determining, wheather a specified point has been visited
+struct ocVisitCycles {
+ BObject* _target;
+ ocVisitCycles(BObject* target) : _target(target) {}
- //bfs:
- //initial node: = obj0
- //expand: for every slot in node add connected pin's owner
- //visit: return true if node == obj1
-
- Expand expand(this);
- bool cycle = tree_algos::bfs(obj0.get(),
- std::bind1st(std::ptr_fun(&_visit_node), obj1.get()),
- expand
- );
- return cycle;
+ int operator()(BObject* obj, int level) {
+ if (_target == obj)
+ return tree_algos::DONE;
+ return tree_algos::CONTINUE;
}
-
- //returns true if it has been disconnected
- //returns false in case of error or if already was not connected
- //NULL pin and slot parameters are allowed
- bool ObjectChain::_disconnect(PinType* pin, SlotType* slot) {
- slot2pin_map::iterator i;
- i = slot2pin.find(slot);
- if(i == slot2pin.end())
- return false;
+};
- if(pin != i->second)
- return false;
+//Order objects in "destruction" order
+//it stores the result in objs
+void ObjectChain::order_back_to_front(ordered_objs& objs) {
+ //for each object in the list, bfs:
+ //initial node: the object
+ //expand: for every slot in node add connected pin's owner
+ //visit: compute the object's rank
+
+ ocVisitRanks visit(this);
+ ocExpand expand(this);
+ object_set::const_iterator i;
+ for (i = objects.begin(); i != objects.end(); ++i)
+ tree_algos::bfs(i->get(),visit,expand);
+ visit.returnOrdered(objs);
+}
- ASSERT(pin && slot);
+//Check for cycles created by edge obj0.pin <- obj1.slot
+bool ObjectChain::check_for_cycles(const RCPtr<BObject>& obj0,
+ const RCPtr<BObject>& obj1) {
+ ASSERT( objects.count(obj0) == 1 ); // must be our object
+ ASSERT( objects.count(obj1) == 1 ); // must be our object
- slot->disconnect();
+ //bfs:
+ //initial node: = obj0
+ //expand: for every slot in node add connected pin's owner
+ //visit: return true if node == obj1
- slot2pin.erase(slot);
- pin2that.erase(pin);
- pin2slot_map::iterator j;
- if(!_find_pin(pin,slot,j))
- ASSERT(false);
- pin2slot.erase(j);
+ ocVisitCycles visit(obj1.get());
+ ocExpand expand(this);
+ bool cycle = tree_algos::bfs(obj0.get(),visit,expand);
+ return cycle;
+}
+
+//returns true if it has been disconnected
+//returns false in case of error or if already was not connected
+//NULL pin and slot parameters are allowed
+bool ObjectChain::_disconnect(PinType* pin, SlotType* slot) {
+ slot2pin_map::iterator i;
+ i = slot2pin.find(slot);
+ if (i == slot2pin.end())
+ return false;
- return true;
- }
+ if (pin != i->second)
+ return false;
- bool ObjectChain::_find_slot(SlotType* slot, slot2pin_map::iterator& i) {
- i = slot2pin.find(slot);
- if(i == slot2pin.end())
- return false;
- return true;
- }
+ ASSERT(pin && slot);
- bool ObjectChain::_find_pin(PinType* pin, SlotType* slot, pin2slot_map::iterator& i) {
- i = pin2slot.find(pin);
- for(; i != pin2slot.end() && i->first == pin; ++i)
- if(i->second == slot)
- return true;
+ slot->disconnect();
+
+ slot2pin.erase(slot);
+ pin2that.erase(pin);
+ pin2slot_map::iterator j;
+ if(!_find_pin(pin,slot,j))
+ ASSERT(false);
+ pin2slot.erase(j);
+
+ return true;
+}
+
+bool ObjectChain::_find_slot(SlotType* slot, slot2pin_map::iterator& i) {
+ i = slot2pin.find(slot);
+ if (i == slot2pin.end())
return false;
- }
+ return true;
+}
- PinType* ObjectChain::_match_pin(SlotType* slot) {
- slot2pin_map::iterator i;
- if(!_find_slot(slot,i))
- return NULL;
- PinType* pin = i->second;
- return pin;
- }
+bool ObjectChain::_find_pin(PinType* pin, SlotType* slot, pin2slot_map::iterator& i) {
+ i = pin2slot.find(pin);
+ for (; i != pin2slot.end() && i->first == pin; ++i)
+ if(i->second == slot)
+ return true;
+ return false;
+}
- BObject* ObjectChain::_match_that(PinType* pin) {
- pin2that_map::iterator i;
- i = pin2that.find(pin);
- if(i == pin2that.end())
- return NULL;
- BObject* that = i->second;
- return that;
- }
+PinType* ObjectChain::_match_pin(SlotType* slot) {
+ slot2pin_map::iterator i;
+ if (!_find_slot(slot,i))
+ return NULL;
+ PinType* pin = i->second;
+ return pin;
+}
- /* nonsense:
- SlotType* ObjectChain::_match_slot(PinType* pin, SlotType* slot) {
- pin2slot_map::iterator i;
- if(!_find_pin(pin,slot,i))
- return NULL;
- SlotType* _slot = i->second;
- return _slot;
- }*/
+BObject* ObjectChain::_match_that(PinType* pin) {
+ pin2that_map::iterator i;
+ i = pin2that.find(pin);
+ if (i == pin2that.end())
+ return NULL;
+ BObject* that = i->second;
+ return that;
+}
+/* nonsense:
+SlotType* ObjectChain::_match_slot(PinType* pin, SlotType* slot) {
+ pin2slot_map::iterator i;
+ if(!_find_pin(pin,slot,i))
+ return NULL;
+ SlotType* _slot = i->second;
+ return _slot;
+}*/
+
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -46,6 +46,8 @@
bool isContained(const RCPtr<BObject>& obj);
+ void complete();
+
bool realize();
void unrealize();
@@ -105,9 +107,9 @@
bool check_for_cycles(const RCPtr<BObject>& obj0,
const RCPtr<BObject>& obj1);
- //expand: for every slot in node add connected pin's owner
- template<template<typename T> class Fringe>
- friend void _expand_node(ObjectChain* ochain, BObject* obj, Fringe<BObject*> fringe);
+ friend struct ocExpand;
+ friend struct ocVisitRanks;
+ friend struct ocVisitCycles;
//returns true if it has been disconnected
//returns false in case of error or if already was not connected
@@ -130,6 +132,7 @@
SlotType* _match_slot(PinType* pin, SlotType* slot);
}*/
+ PinSlotDesc* _get_not_connected(BObject* obj, bool ifPin);
};
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -8,12 +8,16 @@
#include "oregistry.h"
+#include "debugmem.h"
+
namespace Browser {
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// The ObjectRegistry
+typedef Plugin::ObjectPlugins ObjectPlugins;
+
//returns false if there were some conflicts
bool ObjectRegistry::registerPlugin(PluginAccessor pluginAccessor, bool overwrite) {
const Plugin& plugin = pluginAccessor();
@@ -27,43 +31,141 @@
bool res = true;
ObjectPlugins::const_iterator i;
- for(i = oplugs.begin(); i != oplugs.end(); ++i)
+ for (i = oplugs.begin(); i != oplugs.end(); ++i)
{
const ObjectPlugin* oplug = i->second;
ASSERT(oplug);
const BGUID& oguid = oplug->getObjectGUID();
- ObjectMap::iterator i;
- i = objectMap.find(oguid);
- if(i != objectMap.end()) {
+ PluginsMap::iterator i;
+ i = _pluginsMap.find(oguid);
+ if (i != _pluginsMap.end()) {
res = false;
if(overwrite)
i->second = oplug;
continue;
}
- objectMap.insert( std::make_pair(oguid, oplug) );
+ _pluginsMap.insert( std::make_pair(oguid, oplug) );
}
+ //TODO: make this thing below better
+ rebuildPinSlotMaps();
+
return res;
}
-const ObjectPlugin* ObjectRegistry::findObjectPlugin(const BGUID& guid) {
- ObjectPlugins::const_iterator i;
- i = objectMap.find(guid);
- if(i == objectMap.end())
+void ObjectRegistry::rebuildPinSlotMaps() {
+ _pinMap.clear();
+ _slotMap.clear();
+
+ PluginsMap::const_iterator j;
+ for (j = _pluginsMap.begin(); j != _pluginsMap.end(); ++j) {
+
+ const BGUID& objectGuid = j->first;
+ const ObjectPlugin* objectPlugin = j->second;
+
+ PinSlotDescs::const_iterator i;
+
+ const PinSlotDescs& pins = objectPlugin->get_pins();
+ for (i = pins.begin(); i != pins.end(); ++i)
+ {
+ const BGUID& pinGuid = i->first;
+ _pinMap.insert( PinSlotMap::value_type(pinGuid, objectGuid) );
+ }
+
+ const PinSlotDescs& slots = objectPlugin->get_slots();
+ for (i = slots.begin(); i != slots.end(); ++i)
+ {
+ const BGUID& slotGuid = i->first;
+ _slotMap.insert( PinSlotMap::value_type(slotGuid, objectGuid) );
+ }
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+const ObjectPlugin* ObjectRegistry::findObjectPlugin(const BGUID& objectGuid) {
+ PluginsMap::const_iterator i;
+ i = _pluginsMap.find(objectGuid);
+ if (i == _pluginsMap.end())
return NULL;
return i->second;
}
-RCPtr<BObject> ObjectRegistry::getObject(const BGUID& guid) {
- const ObjectPlugin* plug = findObjectPlugin(guid);
- if(!plug)
+RCPtr<BObject> ObjectRegistry::getObject(const BGUID& objectGuid) {
+ const ObjectPlugin* plug = findObjectPlugin(objectGuid);
+ if (!plug)
return NULL;
return plug->newInstance();
}
+RCPtr<BObject> ObjectRegistry::getObjectWithPin(const BGUID& pinGuid) {
+ const ObjectPlugin* plug = findObjectWithPin(pinGuid);
+ if (!plug)
+ return NULL;
+ return plug->newInstance();
+}
+
+RCPtr<BObject> ObjectRegistry::getObjectWithSlot(const BGUID& slotGuid) {
+ const ObjectPlugin* plug = findObjectWithSlot(slotGuid);
+ if (!plug)
+ return NULL;
+ return plug->newInstance();
+}
+
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+const ObjectPlugin* ObjectRegistry::findObjectWithPinOrSlot(const BGUID& pinSlotGuid, bool ifPin) {
+ const PinSlotMap& pinSlotMap = ifPin ? _pinMap : _slotMap;
+
+ PinSlotMap::const_iterator i;
+ i = pinSlotMap.find(pinSlotGuid);
+ if (i != pinSlotMap.end())
+ return findObjectPlugin( i->second );
+
+ return NULL;
+}
+
+const ObjectPlugin* ObjectRegistry::findObjectWithPin(const BGUID& pinGuid) {
+ return findObjectWithPinOrSlot(pinGuid, true);
+}
+
+const ObjectPlugin* ObjectRegistry::findObjectWithSlot(const BGUID& slotGuid) {
+ return findObjectWithPinOrSlot(slotGuid, false);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+std::list<const ObjectPlugin*> ObjectRegistry::findObjectsWithPinOrSlot(const BGUID& pinSlotGuid, bool ifPin) {
+ const PinSlotMap& pinSlotMap = ifPin ? _pinMap : _slotMap;
+
+ PinSlotMap::const_iterator i;
+ i = pinSlotMap.find(pinSlotGuid);
+
+ std::list<const ObjectPlugin*> plugins;
+ for (; i != pinSlotMap.end() && i->first == pinSlotGuid; ++i) {
+ const ObjectPlugin* plugin = findObjectPlugin( i->second );
+ if (!plugin)
+ continue;
+ plugins.push_back( plugin );
+ }
+
+ return plugins;
+}
+
+std::list<const ObjectPlugin*> ObjectRegistry::findObjectsWithPin(const BGUID& pinGuid) {
+ return findObjectsWithPinOrSlot(pinGuid, true);
+}
+
+std::list<const ObjectPlugin*> ObjectRegistry::findObjectsWithSlot(const BGUID& slotGuid) {
+ return findObjectsWithPinOrSlot(slotGuid, false);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
} // namespace Browser
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -12,6 +12,8 @@
#include "plugin.h"
+#include <list>
+
namespace Browser {
/////////////////////////////////////////////////////////////////////////////
@@ -19,29 +21,56 @@
// The ObjectRegistry
class ObjectRegistry {
-public:
+
//CAUTION: the Plugin::ObjectPlugins map is keyed with the plugins GUID, not
// it's object's GUID.
- //CAUTION: the ObjectMap map is keyed with the object's GUID, not
+ //CAUTION: the PluginsMap map is keyed with the object's GUID, not
// it's plugin's GUID.
- typedef Plugin::ObjectPlugins ObjectPlugins;
- typedef std::map<const BGUID, const ObjectPlugin*> ObjectMap;
- ObjectMap objectMap;
+ typedef std::map<const BGUID, const ObjectPlugin*> PluginsMap;
+ PluginsMap _pluginsMap;
+ //maps from pin/slot's GUID to object's GUID
+ typedef std::multimap<const BGUID, const BGUID> PinSlotMap;
+ PinSlotMap _pinMap;
+ PinSlotMap _slotMap;
+
typedef const Plugin& (*PluginAccessor)();
+public:
//returns false if there were some conflicts
bool registerPlugin(PluginAccessor pluginAccessor, bool overwrite);
+
//returns false if there were some conflicts
bool registerPlugin(const Plugin& plugin, bool overwrite);
- const ObjectPlugin* findObjectPlugin(const BGUID& guid);
- RCPtr<BObject> getObject(const BGUID& guid);
+ const ObjectPlugin* findObjectPlugin(const BGUID& objectGuid);
+
+ RCPtr<BObject> getObject(const BGUID& objectGuid);
+ RCPtr<BObject> getObjectWithPin(const BGUID& pinGuid);
+ RCPtr<BObject> getObjectWithSlot(const BGUID& slotGuid);
+
template<typename T>
RCPtr<T> getObject() {
RCPtr<BObject> obj( getObject(T::static_GUID()) );
return static_cast<T*>(obj.get());
}
+
+ std::list<const ObjectPlugin*> findObjectsWithPinOrSlot(const BGUID& pinSlotGuid, bool ifPin);
+ std::list<const ObjectPlugin*> findObjectsWithPin(const BGUID& pinGuid);
+ std::list<const ObjectPlugin*> findObjectsWithSlot(const BGUID& slotGuid);
+
+ const ObjectPlugin* findObjectWithPinOrSlot(const BGUID& pinSlotGuid, bool ifPin);
+ const ObjectPlugin* findObjectWithPin(const BGUID& pinGuid);
+ const ObjectPlugin* findObjectWithSlot(const BGUID& slotGuid);
+
+
+ static ObjectRegistry* get() {
+ static ObjectRegistry instance;
+ return &instance;
+ }
+
+private:
+ void rebuildPinSlotMaps();
};
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -357,7 +357,8 @@
//invoked to uninitialize the object in the ObjectChain
//unrealize can query the ObjectChain (the object is still a member of it)
virtual void unrealize(ObjectChain* ochain) {
- ASSERT( _realized && (_ochain == ochain) );
+ if(!isRealized(ochain))
+ return;
_ochain = NULL;
_realized = false;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -20,16 +20,59 @@
template<typename T>
struct Fringe {
- void push(T _val);
+ virtual void push(const T& _val, int _level) = 0;
+ virtual void pop() = 0;
+ virtual T& front() = 0;
+ virtual int level() = 0;
+ virtual bool empty() = 0;
};
template<typename T>
-struct FIFO : std::queue<T> {};
+struct FIFO : Fringe<T> {
+ std::queue<T> q;
+ std::queue<int> levels;
+
+ virtual bool empty() {
+ return q.empty();
+ }
+ virtual void push(const T& _val, int _level) {
+ q.push(_val);
+ levels.push(_level);
+ }
+ virtual void pop() {
+ q.pop();
+ levels.pop();
+ }
+ virtual T& front() {
+ return q.front();
+ }
+ virtual int level() {
+ return levels.front();
+ }
+};
+
template<typename T>
-struct LIFO : std::stack<T> {
- T& front() {
- return this->top();
+struct LIFO : Fringe<T> {
+ std::stack<T> s;
+ std::stack<int> levels;
+
+ virtual bool empty() {
+ return q.empty();
}
+ virtual void push(const T& _val, int _level) {
+ s.push(_val);
+ levels.push(_level);
+ }
+ virtual void pop() {
+ s.pop();
+ levels.pop();
+ }
+ virtual T& front() {
+ return s.top();
+ }
+ virtual int level() {
+ return levels.top();
+ }
};
#define bfs_fringe FIFO
@@ -42,33 +85,34 @@
};
template<typename Node, typename VisitFun, typename ExpandFun>
-bool bfs(Node initial, VisitFun visitFun, ExpandFun expandFun) {
+bool bfs(Node initial, VisitFun& visitFun, ExpandFun& expandFun) {
return tree_search< bfs_fringe<Node> >(initial, visitFun, expandFun);
}
template<typename Node, typename VisitFun, typename ExpandFun>
-bool dfs(Node initial, VisitFun visitFun, ExpandFun expandFun) {
+bool dfs(Node initial, VisitFun& visitFun, ExpandFun& expandFun) {
return tree_search< dfs_fringe<Node> >(initial, visitFun, expandFun);
}
template<typename Fringe, typename Node, typename VisitFun, typename ExpandFun>
-bool tree_search(Node initial, VisitFun visitFun, ExpandFun expandFun)
+bool tree_search(Node initial, VisitFun& visitFun, ExpandFun& expandFun)
{
Fringe fringe;
- fringe.push(initial);
+ fringe.push(initial, 0);
while(true)
{
if(fringe.empty())
return false;
Node node(fringe.front());
+ int level(fringe.level());
fringe.pop();
- int res = visitFun(node);
+ int res = visitFun(node, level);
if(res == DONE)
return true;
if(res != SKIP)
- expandFun(node, fringe);
+ expandFun(node, level, fringe);
}
}
Added: scummex/branches/gsoc2007-gameresbrowser/src/data/lisy.bmp
===================================================================
(Binary files differ)
Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/data/lisy.bmp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: scummex/branches/gsoc2007-gameresbrowser/src/data/pies.bmp
===================================================================
(Binary files differ)
Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/data/pies.bmp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -14,7 +14,8 @@
#endif
#include "BrowserApp.h"
-#include "BrowserDlg.h"
+//#include "BrowserDlg.h"
+#include "MainForm.h"
#include "guicon.h"
IMPLEMENT_APP(BrowserDlgApp)
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -14,33 +14,84 @@
#include <wx/wx.h>
#endif
-#include "VirtualNode.h"
+#include "ochain.h"
namespace Browser {
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+//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 {
- static wxTreeCtrl* _explorationTree;
-public:
- static wxTreeCtrl* get() {
+ static ExplorationTree* _instance;
+
+ wxTreeCtrl* _explorationTree;
+ ObjectChain* _rootObjectChain;
+
+ ExplorationTree(wxTreeCtrl* explorationTree)
+ : _explorationTree(explorationTree) {
ASSERT(_explorationTree);
- return _explorationTree;
+ _rootObjectChain = new ObjectChain();
}
- static wxTreeCtrl* getExplorationTree() {
+
+ ~ExplorationTree() {
+ delete _rootObjectChain; //unrealize
+ }
+
+public:
+ static ExplorationTree* get() {
+ ASSERT(_instance);
+ return _instance;
+ }
+ static void initialize(wxTreeCtrl* explorationTree) {
+ ASSERT(!_instance);
+ _instance = new ExplorationTree(explorationTree);
+ }
+ static void shutdown() {
+ ASSERT(_instance);
+ delete _instance;
+ }
+
+ static wxTreeCtrl* _getTree() {
+ return get()->getTree();
+ }
+
+ wxTreeCtrl* getTree() {
return _explorationTree;
}
- static setExplorationTree(wxTreeCtrl* explorationTree) {
- _explorationTree = explorationTree;
+
+ ObjectChain* getRootObjectChain() {
+ return _rootObjectChain;
}
-}
-wxTreeCtrl* ExplorationTree::_explorationTree = NULL;
+ /*void unrealize() {
+ _rootObjectChain->unrealize();
+ }*/
+};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+class MainPanel {
+ static wxPanel *_mainPanel;
+public:
+ static wxPanel* get() {
+ ASSERT(_mainPanel);
+ return _mainPanel;
+ }
+ static wxPanel* getMainPanel() {
+ return _mainPanel;
+ }
+ static void setMainPanel(wxPanel* mainPanel) {
+ _mainPanel = mainPanel;
+ }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
}
#endif //_EXPLORATION_TREE_H_
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -17,6 +17,7 @@
#include "BMPParser.h" //for now - for IImage
#include "BitmapPanel.h" //for now - for IImage
+#include "ExplorationTree.h" //for now - for IImage
#include <iostream>
@@ -31,7 +32,7 @@
protected:
Slot<IImage>* _imageSlot;
- wxPanel* _targetPanel;
+ //wxPanel* _targetPanel;
wxBitmap* _bitmap;
public:
@@ -41,8 +42,8 @@
SLOT_DESC(_imageSlot, SLOT_DEFAULT)
END_DESCS
- ImagePresenter(wxPanel* targetPanel)
- : _targetPanel(targetPanel), _bitmap(NULL) {}
+ ImagePresenter()
+ : _bitmap(NULL) {}
~ImagePresenter() {
//_targetPanel->SetBackground(wxNullBitmap);
@@ -50,13 +51,21 @@
delete _bitmap;
}
- void drawImage() {
- std::cout << "ImagePresenter::drawImage()" << std::endl;
+ virtual bool realize(ObjectChain* ochain) {
+ std::cout << "ImagePresenter::realize()" << std::endl;
+
+ bool res = BObject::realize(ochain);
+ if (!res)
+ return false;
+
+ wxPanel* _targetPanel = MainPanel::get();
+
if(!_bitmap) {
IImage* iimage = _imageSlot->getInterface();
if(!iimage) {
std::cout << " -- could not get IImage interface" << std::endl;
- return;
+ unrealize(ochain);
+ return false;
}
//std::cout << " -- bitmap: " << bitmap->getBitmap() << std::endl;
@@ -64,10 +73,21 @@
_imageSlot->releaseInterface();
}
//_targetPanel->SetBackground(_bitmap);
- _targetPanel->SetBackgroundColour(wxTheColourDatabase->Find("RED"));
- //new BitmapPanel(_targetPanel,*_bitmap);
+ //_targetPanel->SetBackgroundColour(wxTheColourDatabase->Find("RED"));
+ wxSizer* sizer = _targetPanel->GetSizer();
+ BitmapPanel* bmpPanel = new BitmapPanel(_targetPanel,*_bitmap);
+ sizer->Add(bmpPanel, 1, wxALL, 3);
+ sizer->Layout();
+
+ return true;
}
+ virtual void unrealize(ObjectChain* ochain) {
+ if(!isRealized(ochain))
+ return;
+
+ BObject::unrealize(ochain);
+ }
};
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -16,7 +16,16 @@
#include "MainForm.h"
#include "ExplorationTree.h"
+#include "VirtualNode.h"
+#include "debugmem.h"
+
+using namespace Browser;
+
+ExplorationTree* ExplorationTree::_instance = NULL;
+wxPanel* MainPanel::_mainPanel = NULL;
+
+
//Do not add custom headers between
//Header Include Start and Header Include End
//wxDev-C++ designer will remove them
@@ -35,21 +44,28 @@
EVT_CLOSE(MainForm::OnClose)
EVT_MENU(wxID_EXIT, MainForm::OnExit)
+ EVT_MENU(ID_TEST1, MainForm::OnTest1)
+ EVT_MENU(ID_TEST1_CLEANUP, MainForm::OnTest1Cleanup)
END_EVENT_TABLE()
////Event Table End
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();
+ CreateGUIControls();
+ SetClientSize( wxSize(640, 480) );
+ GetSizer()->SetMinSize(640, 480);
+ mainPanel->SetMinSize( wxSize(400, 300) );
+ mainPanel->SetSize( wxSize(400, 300) );
+ Layout();
- ExplorationTree::setExplorationTree(browserTree);
- VirtualNode* _rootVirtualNode = NULL;
- browserTree->AddRoot(_T("TheRoot"), -1, -1, new VirtualNodeItemData(_rootVirtualNode));
+ ExplorationTree::initialize(browserTree);
+ MainPanel::setMainPanel(mainPanel);
}
MainForm::~MainForm()
{
+ ExplorationTree::shutdown();
}
void MainForm::CreateGUIControls()
@@ -60,31 +76,46 @@
//Add the custom code before or after the blocks
////GUI Items Creation Start
- WxSplitterWindow1 = new wxSplitterWindow(this, ID_WXSPLITTERWINDOW1, wxPoint(0,0), wxSize(606,392));
+ WxBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
+ this->SetSizer(WxBoxSizer1);
+ this->SetAutoLayout(true);
+
+ WxSplitterWindow1 = new wxSplitterWindow(this, ID_WXSPLITTERWINDOW1, wxPoint(0,0), wxSize(578,392));
WxSplitterWindow1->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+ WxBoxSizer1->Add(WxSplitterWindow1,1,wxALIGN_CENTER | wxEXPAND | wxALL,0);
- browserTree = new wxTreeCtrl(WxSplitterWindow1, ID_BROWSERTREE, wxPoint(5,5), wxSize(243,382), wxTR_HAS_BUTTONS);
- browserTree->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
-
- mainPanel = new wxPanel(WxSplitterWindow1, ID_MAINPANEL, wxPoint(258,8), wxSize(333,376));
- mainPanel->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
-
WxMenuBar1 = new wxMenuBar();
wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
ID_FILE_MENU_Mnu_Obj->Append(ID_OPEN, wxT("Open..."), wxT(""), wxITEM_NORMAL);
+ ID_FILE_MENU_Mnu_Obj->Enable(ID_OPEN,false);
ID_FILE_MENU_Mnu_Obj->AppendSeparator();
ID_FILE_MENU_Mnu_Obj->Append(wxID_EXIT, wxT("Exit"), wxT(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("File"));
wxMenu *ID_EDIT_MENU_Mnu_Obj = new wxMenu(0);
+ ID_EDIT_MENU_Mnu_Obj->Append(ID_TEST1, wxT("Test1"), wxT(""), wxITEM_NORMAL);
+ ID_EDIT_MENU_Mnu_Obj->Append(ID_TEST1_CLEANUP, wxT("Test1 Cleanup"), wxT(""), wxITEM_NORMAL);
WxMenuBar1->Append(ID_EDIT_MENU_Mnu_Obj, wxT("Edit"));
SetMenuBar(WxMenuBar1);
+ browserTree = new wxTreeCtrl(WxSplitterWindow1, ID_BROWSERTREE, wxPoint(5,5), wxSize(185,382), wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT);
+ browserTree->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+
+ mainPanel = new wxPanel(WxSplitterWindow1, ID_MAINPANEL, wxPoint(200,8), wxSize(363,376));
+ mainPanel->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+
+ WxBoxSizer2 = new wxBoxSizer(wxVERTICAL);
+ mainPanel->SetSizer(WxBoxSizer2);
+ mainPanel->SetAutoLayout(true);
+
WxSplitterWindow1->SplitVertically(browserTree,mainPanel,329);
SetTitle(wxT("Game Resource Browser"));
SetIcon(wxNullIcon);
- SetSize(8,8,614,419);
+
+ GetSizer()->Layout();
+ GetSizer()->Fit(this);
+ GetSizer()->SetSizeHints(this);
Center();
////GUI Items Creation End
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -25,10 +25,11 @@
//Header Include Start and Header Include End.
//wxDev-C++ designer will remove them. Add custom headers after the block.
////Header Include Start
-#include <wx/menu.h>
#include <wx/panel.h>
#include <wx/treectrl.h>
+#include <wx/menu.h>
#include <wx/splitter.h>
+#include <wx/sizer.h>
////Header Include End
////Dialog Style Start
@@ -45,16 +46,20 @@
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();
void ExitClick(wxCommandEvent& event);
+ void OnTest1Cleanup(wxCommandEvent& event);
+ void OnTest1(wxCommandEvent& event);
private:
//Do not add custom control declarations between
//GUI Control Declaration Start and GUI Control Declaration End.
//wxDev-C++ will remove them. Add custom code after the block.
////GUI Control Declaration Start
- wxMenuBar *WxMenuBar1;
+ wxBoxSizer *WxBoxSizer2;
wxPanel *mainPanel;
wxTreeCtrl *browserTree;
+ wxMenuBar *WxMenuBar1;
wxSplitterWindow *WxSplitterWindow1;
+ wxBoxSizer *WxBoxSizer1;
////GUI Control Declaration End
private:
@@ -65,19 +70,22 @@
enum
{
////GUI Enum Control ID Start
+ ID_MAINPANEL = 1017,
+ ID_BROWSERTREE = 1016,
ID_FILE_MENU = 1004,
ID_OPEN = 1005,
ID_EDIT_MENU = 1010,
+ ID_TEST1 = 1011,
+ ID_TEST1_CLEANUP = 1012,
- ID_MAINPANEL = 1003,
- ID_BROWSERTREE = 1002,
- ID_WXSPLITTERWINDOW1 = 1001,
+ ID_WXSPLITTERWINDOW1 = 1014,
////GUI Enum Control ID End
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
};
private:
void OnClose(wxCloseEvent& event);
+ void OnExit(wxCommandEvent& event);
void CreateGUIControls();
};
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.wxform 2007-07-02 01:45:25 UTC (rev 27847)
@@ -1,11 +1,11 @@
object frmNewForm: TfrmNewForm
- Left = 8
- Top = 8
+ Left = 13
+ Top = 15
AutoScroll = False
BorderIcons = [biSystemMenu, biMinimize]
Caption = 'Game Resource Browser'
ClientHeight = 392
- ClientWidth = 606
+ ClientWidth = 571
Color = clAppWorkSpace
OldCreateOrder = True
PopupMenu = MainForm.DesignerPopup
@@ -30,67 +30,98 @@
Wx_BorderAlignment = []
PixelsPerInch = 96
TextHeight = 13
- object WxSplitterWindow1: TWxSplitterWindow
+ object WxBoxSizer1: TWxBoxSizer
Left = 0
Top = 0
- Width = 606
+ Width = 571
Height = 392
Align = alClient
TabOrder = 0
- Wx_Class = 'wxSplitterWindow'
+ Wx_Class = 'wxBoxSizer'
Wx_ControlOrientation = wxControlVertical
- Wx_EventList.Strings = (
- 'EVT_SPLITTER_SASH_POS_CHANGING : OnSashPosChanging'
- 'EVT_SPLITTER_SASH_POS_CHANGED : OnSashPosChanged'
- 'EVT_SPLITTER_UNSPLIT : OnUnSplit'
- 'EVT_SPLITTER_DCLICK : OnDoubleClick'
- 'EVT_UPDATE_UI : OnUpdateUI')
- Wx_IDName = 'ID_WXSPLITTERWINDOW1'
- Wx_IDValue = 1001
- Wx_SashPosition = 329
- Wx_GeneralStyle = []
- Wx_SplitterStyle = []
- Wx_Border = 0
- Wx_StretchFactor = 1
- object browserTree: TWxTreeCtrl
- Left = 5
- Top = 5
- Width = 243
- Height = 382
- Indent = 19
+ Wx_IDName = 'ID_WXBOXSIZER1'
+ Wx_IDValue = 1013
+ object WxSplitterWindow1: TWxSplitterWindow
+ Left = 0
+ Top = 0
+ Width = 578
+ Height = 392
TabOrder = 0
- Wx_BGColor = clBlack
- Wx_Class = 'wxTreeCtrl'
- Wx_ControlOrientation = wxControlHorizontal
- Wx_FGColor = clBlack
- Wx_GeneralStyle = []
- Wx_Hidden = False
- Wx_IDName = 'ID_BROWSERTREE'
- Wx_IDValue = 1002
- Wx_TreeviewStyle = [wxTR_HAS_BUTTONS]
- end
- object mainPanel: TWxPanel
- Left = 258
- Top = 8
- Width = 333
- Height = 376
- TabOrder = 1
- Wx_BKColor = clBlack
- Wx_Class = 'wxPanel'
- Wx_ControlOrientation = wxControlHorizontal
- Wx_Default = False
+ Wx_Class = 'wxSplitterWindow'
+ Wx_ControlOrientation = wxControlVertical
Wx_EventList.Strings = (
- 'EVT_UPDATE_UI:OnUpdateUI')
- Wx_FGColor = clBlack
+ 'EVT_SPLITTER_SASH_POS_CHANGING : OnSashPosChanging'
+ 'EVT_SPLITTER_SASH_POS_CHANGED : OnSashPosChanged'
+ 'EVT_SPLITTER_UNSPLIT : OnUnSplit'
+ 'EVT_SPLITTER_DCLICK : OnDoubleClick'
+ 'EVT_UPDATE_UI : OnUpdateUI')
+ Wx_IDName = 'ID_WXSPLITTERWINDOW1'
+ Wx_IDValue = 1014
+ Wx_SashPosition = 329
Wx_GeneralStyle = []
- Wx_Hidden = False
- Wx_IDName = 'ID_MAINPANEL'
- Wx_IDValue = 1003
+ Wx_SplitterStyle = []
+ Wx_Border = 0
+ Wx_Alignment = [wxALIGN_CENTER, wxEXPAND]
+ Wx_StretchFactor = 1
+ object browserTree: TWxTreeCtrl
+ Left = 5
+ Top = 5
+ Width = 185
+ Height = 382
+ Indent = 19
+ TabOrder = 0
+ Wx_BGColor = clBlack
+ Wx_Class = 'wxTreeCtrl'
+ Wx_ControlOrientation = wxControlHorizontal
+ Wx_FGColor = clBlack
+ Wx_GeneralStyle = []
+ Wx_Hidden = False
+ Wx_IDName = 'ID_BROWSERTREE'
+ Wx_IDValue = 1016
+ Wx_TreeviewStyle = [wxTR_HAS_BUTTONS, wxTR_LINES_AT_ROOT]
+ Wx_Alignment = [wxALIGN_CENTER, wxEXPAND]
+ Wx_StretchFactor = 1
+ end
+ object mainPanel: TWxPanel
+ Left = 200
+ Top = 8
+ Width = 363
+ Height = 376
+ TabOrder = 1
+ Wx_BKColor = clBlack
+ Wx_Class = 'wxPanel'
+ Wx_ControlOrientation = wxControlHorizontal
+ Wx_Default = False
+ Wx_EventList.Strings = (
+ 'EVT_UPDATE_UI:OnUpdateUI')
+ Wx_FGColor = clBlack
+ Wx_GeneralStyle = []
+ Wx_Hidden = False
+ Wx_IDName = 'ID_MAINPANEL'
+ Wx_IDValue = 1017
+ Wx_Alignment = [wxALIGN_CENTER, wxEXPAND]
+ Wx_StretchFactor = 1
+ object WxBoxSizer2: TWxBoxSizer
+ Left = 1
+ Top = 1
+ Width = 361
+ Height = 374
+ Align = alClient
+ TabOrder = 0
+ Orientation = wxVertical
+ Wx_Class = 'wxBoxSizer'
+ Wx_ControlOrientation = wxControlVertical
+ Wx_IDName = 'ID_WXBOXSIZER2'
+ Wx_IDValue = 1018
+ Wx_Alignment = [wxALIGN_CENTER, wxEXPAND]
+ Wx_StretchFactor = 1
+ end
+ end
end
end
object WxMenuBar1: TWxMenuBar
- Left = 63
- Top = 90
+ Left = 288
+ Top = 117
Width = 28
Height = 27
TabOrder = 1
@@ -191,7 +222,7 @@
65642E5778437573746F6D4D656E754974656D0AC90300001100000054577843
7573746F6D4D656E754974656D5450463018547778437573746F6D4D656E7549
74656D577261707065720011436172726965642E49735375624D656E75081243
- 6172726965642E57785F456E61626C65640911436172726965642E57785F4869
+ 6172726965642E57785F456E61626C65640811436172726965642E57785F4869
6464656E0811436172726965642E57785F49444E616D65060749445F4F50454E
12436172726965642E57785F494456616C756503ED0318436172726965642E57
785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C
@@ -228,7 +259,30 @@
0F77784D6E7549746D5F4E6F726D616C12436172726965642E57785F43617074
696F6E06044564697412436172726965642E57785F436865636B656408164361
72726965642E57585F4249544D41502E446174610A0C00000007544269746D61
- 700000000016436172726965642E57785F46696C65486973746F7279080000}
+ 700000000016436172726965642E57785F46696C65486973746F727908184361
+ 72726965642E5778437573746F6D4D656E754974656D0ABD0200001100000054
+ 5778437573746F6D4D656E754974656D5450463018547778437573746F6D4D65
+ 6E754974656D577261707065720011436172726965642E49735375624D656E75
+ 0810436172726965642E4556545F4D656E7506074F6E54657374311243617272
+ 6965642E57785F456E61626C65640911436172726965642E57785F4869646465
+ 6E0811436172726965642E57785F49444E616D65060849445F54455354311243
+ 6172726965642E57785F494456616C756503F30318436172726965642E57785F
+ 4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C1243
+ 6172726965642E57785F43617074696F6E060554657374311243617272696564
+ 2E57785F436865636B65640816436172726965642E57585F4249544D41502E44
+ 6174610A0C00000007544269746D61700000000016436172726965642E57785F
+ 46696C65486973746F727908000011000000545778437573746F6D4D656E7549
+ 74656D5450463018547778437573746F6D4D656E754974656D57726170706572
+ 0011436172726965642E49735375624D656E750810436172726965642E455654
+ 5F4D656E75060E4F6E5465737431436C65616E757012436172726965642E5778
+ 5F456E61626C65640911436172726965642E57785F48696464656E0811436172
+ 726965642E57785F49444E616D65061049445F54455354315F434C45414E5550
+ 12436172726965642E57785F494456616C756503F40318436172726965642E57
+ 785F4D656E754974656D5374796C65070F77784D6E7549746D5F4E6F726D616C
+ 12436172726965642E57785F43617074696F6E060D546573743120436C65616E
+ 757012436172726965642E57785F436865636B65640816436172726965642E57
+ 585F4249544D41502E446174610A0C00000007544269746D6170000000001643
+ 6172726965642E57785F46696C65486973746F72790800000000}
Wx_HasHistory = False
end
end
Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -0,0 +1,88 @@
+//---------------------------------------------------------------------------
+//
+// Name: MainForm.cpp
+// Author: Zbyl
+// Created: 2007-07-01 11:17:49
+// Description: MainForm class implementation
+//
+//---------------------------------------------------------------------------
+
+#include "wx/wxprec.h"
+
+#if defined(__BORLANDC__)
+#pragma hdrstop
+#endif
+
+#include "MainForm.h"
+
+#include "plugin.h"
+
+#include "ExplorationTree.h"
+#include "VirtualNode.h"
+#include "BMPParser.h"
+#include "ImagePresenter.h"
+
+#include "debugmem.h"
+
+using namespace Browser;
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PLUGIN_DESC(Test1Plugin, "MyPlugins", 1)
+ //PLUGGED_OBJECT(RootDirectory)
+ PLUGGED_OBJECT(DirectoryPresenter)
+ PLUGGED_OBJECT(BMPParser)
+ PLUGGED_OBJECT(ImagePresenter)
+PLUGIN_END_EX(Test1Plugin)
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+void MainForm::OnTest1(wxCommandEvent& event)
+{
+ wxTreeItemId rootItem = ExplorationTree::_getTree()->
+ AddRoot(_T("RootDirectory"), -1, -1, NULL);
+
+ RCPtr<RootDirectory> rootDir( new RootDirectory(rootItem) );
+
+ ExplorationTree::_getTree()->SetItemData(rootItem,
+ new VirtualNodeItemData( rootDir.get() ) );
+
+
+ rootDir->addFile("Doll", "data\\lalka.bmp");
+ rootDir->addFile("Dog", "data\\pies.bmp");
+ rootDir->addFile("Foxes", "data\\lisy.bmp");
+
+ ObjectRegistry::get()->registerPlugin( &getTest1Plugin, true );
+
+ ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+ rootChain->addObject(rootDir);
+
+ //RCPtr<BMPParser> bmp(new BMPParser());
+ //RCPtr<ImagePresenter> pres(new ImagePresenter( MainPanel::get() ));
+ //rootChain->addObject(pres);
+
+ rootChain->complete();
+ bool res = rootChain->realize();
+
+ if (!res) {
+ wxMessageBox(_T("ObjectChain realisation failed."), _T("Test1 Failed"),
+ wxOK | wxICON_ERROR, this);
+ }
+
+ //Layout();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+void MainForm::OnTest1Cleanup(wxCommandEvent& event)
+{
+ ExplorationTree::_getTree()->DeleteAllItems();
+ ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
+ rootChain->removeAllObjects();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp (rev 0)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -0,0 +1,209 @@
+/////////////////////////////////////////////////////////////////////////////
+// VirtualNode.cpp
+
+#include "wx/wxprec.h"
+
+#if defined(__BORLANDC__)
+#pragma hdrstop
+#endif
+
+#include "VirtualNode.h"
+#include "common/simplefile.h"
+
+#include <iostream>
+
+#include "debugmem.h"
+
+namespace Browser {
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class INodeProviderImpl : public INodeProvider {
+protected:
+ VirtualNode* _node;
+public:
+ //inherit guid - it's a concrete implementation of an abstract interface
+ INodeProviderImpl(VirtualNode* node)
+ : _node(node) {}
+
+ virtual VirtualNode* getNode() {
+ std::cout << "INodeProviderImpl::getNode()" << std::endl;
+ return _node;
+ }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+VirtualNode* VirtualNode::getParent() {
+ wxTreeItemId parentTreeItem = ExplorationTree::_getTree()->GetItemParent(_mineTreeItem);
+ return VirtualNodeItemData::getNode(parentTreeItem);
+}
+
+
+PIN_DESCS_EX(VirtualNode)
+ PIN_DESC(_nodePin, 0, getNodeProviderImpl, releaseNodeProviderImpl)
+END_DESCS
+
+INodeProviderImpl* VirtualNode::getNodeProviderImpl() {
+ std::cout << "VirtualNode::getNodeProviderImpl()" << std::endl;
+ return new INodeProviderImpl(this);
+}
+
+void VirtualNode::releaseNodeProviderImpl(INodeProviderImpl* iface) {
+ std::cout << "VirtualNode::releaseNodeProviderImpl()" << std::endl;
+ delete iface;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class IDirectoryImpl : public IDirectory {
+protected:
+ const std::list<IFile*> _files;
+public:
+ //inherit guid - it's a concrete implementation of an abstract interface
+ IDirectoryImpl(const std::list<IFile*>& files)
+ : _files(files) {}
+
+ virtual const std::list<IFile*>& getFiles() {
+ std::cout << "IDirectoryImpl::getFiles()" << std::endl;
+ return _files;
+ }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+PIN_DESCS_EX(RootDirectory)
+ PIN_DESC(_directoryPin, PIN_DEFAULT, getDirectoryImpl, releaseDirectoryImpl)
+END_DESCS
+
+bool RootDirectory::addFile(std::string name, std::string fullpath) {
+ _files.push_back( std::make_pair(name, fullpath) );
+ return true;
+}
+
+IDirectoryImpl* RootDirectory::getDirectoryImpl() {
+ std::cout << "RootDir::getDirectoryImpl()" << std::endl;
+
+ std::list<IFile*> files;
+ file_list::const_iterator i;
+ for (i = _files.begin(); i != _files.end(); ++i) {
+ const std::string& name = i->first;
+ const std::string& fullpath = i->second;
+
+ Common::SimpleFile* file = new Common::SimpleFile();
+ bool res = file->open( fullpath.c_str() );
+ if (!res) {
+ delete file;
+ continue;
+ }
+
+ files.push_back( new IFileImpl(name, file, true) );
+ }
+
+ IDirectoryImpl* idir = new IDirectoryImpl(files);
+ return idir;
+}
+
+void RootDirectory::releaseDirectoryImpl(IDirectoryImpl* iface) {
+ std::cout << "RootDir::releaseDirectoryImpl()" << std::endl;
+
+ const std::list<IFile*>& files = iface->getFiles();
+ std::list<IFile*>::const_iterator i;
+ for (i = files.begin(); i != files.end(); ++i) {
+ delete *i;
+ }
+
+ delete iface;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+bool DirectoryPresenter::realize(ObjectChain* ochain) {
+ bool res = BObject::realize(ochain);
+ if (!res)
+ return false;
+
+ _idirectory = _directorySlot->getInterface();
+ _inodeprovider = _nodeSlot->getInterface();
+ if (!_idirectory || !_inodeprovider) {
+ _directorySlot->releaseInterface();
+ _nodeSlot->releaseInterface();
+ _realized = false;
+ return false;
+ }
+
+ VirtualNode* parent = _inodeprovider->getNode();
+ ExplorationTree::_getTree()->SetItemHasChildren(parent->getTreeItem(), true);
+
+ const std::list<IFile*>& files = _idirectory->getFiles();
+ std::list<IFile*>::const_iterator i;
+ for (i = files.begin(); i != files.end(); ++i) {
+ IFile* ifile = *i;
+
+ wxTreeItemId kidTreeItem = ExplorationTree::_getTree()->
+ AppendItem(parent->getTreeItem(), ifile->getName().c_str(), -1, -1, NULL);
+
+ RCPtr<VirtualFile> virtualFile( new VirtualFile(kidTreeItem, ifile) );
+
+ ExplorationTree::_getTree()->SetItemData(kidTreeItem,
+ new VirtualNodeItemData( virtualFile.get() ) );
+
+ ObjectChain* kidchain = new ObjectChain();
+
+ if ( !kidchain->addObject(virtualFile) ) {
+ delete kidchain;
+ //virtualFile is deleted automatically
+ continue;
+ }
+
+ _kidChains.push_back( kidchain );
+ }
+
+ if (!realizeKidChains()) {
+ unrealize(ochain);
+ return false;
+ }
+
+ return true;
+}
+
+bool DirectoryPresenter::realizeKidChains() {
+ bool res = true;
+ std::list<ObjectChain*>::const_iterator i;
+ for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
+ ObjectChain* kidchain = *i;
+ kidchain->complete();
+ res &= kidchain->realize();
+ }
+ return res;
+}
+
+void DirectoryPresenter::unrealize(ObjectChain* ochain) {
+ if(!isRealized(ochain))
+ return;
+
+ VirtualNode* parent = _inodeprovider->getNode();
+ ExplorationTree::_getTree()->DeleteChildren( parent->getTreeItem() );
+
+ std::list<ObjectChain*>::const_iterator i;
+ for (i = _kidChains.begin(); i != _kidChains.end(); ++i) {
+ ObjectChain* kidchain = *i;
+ delete kidchain; //unrealize
+ }
+ _kidChains.clear();
+
+ _directorySlot->releaseInterface();
+ _nodeSlot->releaseInterface();
+
+ BObject::unrealize(ochain);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+}
Property changes on: scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/VirtualNode.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -15,77 +15,194 @@
#include <wx/dialog.h>
#endif
+#include <wx/treectrl.h>
+
#include "pinslot.h"
+#include "DiskFileProvider.h" //temporary - for IFile
+#include "ExplorationTree.h" //temporary - for IFile
+#include <list>
+
namespace Browser {
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+class VirtualNode;
+
struct VirtualNodeItemData : public wxTreeItemData {
- RCPtr<VirtualNode> _node;
+ VirtualNode* _node;
- VirtualNodeItemData(RCPtr<VirtualNode> node)
+ VirtualNodeItemData(VirtualNode* node)
: _node(node) {}
- virtual ~VirtualNodeItemData() {}
+ //virtual ~VirtualNodeItemData() {}
static VirtualNode* getNode(const wxTreeItemId& item) {
if(!item.IsOk())
return NULL;
- VirtualNodeItemData* data = static_cast<VirtualNodeItemData*>ExplorationTree::get()
- ->GetItemData(item);
- return data->_node.get();
+ VirtualNodeItemData* data = static_cast<VirtualNodeItemData*>
+ (ExplorationTree::_getTree()->GetItemData(item));
+ return data->_node;
}
};
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class INodeProvider : public IInterface {
+public:
+ GUID_FOR(INodeProvider, "CoreInterfaces", 1);
+ virtual VirtualNode* getNode() = 0;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class INodeProviderImpl;
+
+//TODO: make it realizable in multiple chains
class VirtualNode : public BObject {
+ DECLARE_BOBJECT_CLASS(VirtualNode, BObject)
+
+ //std::string _name;
wxTreeItemId _mineTreeItem;
- std::string _name;
-public:
+protected:
+ Pin<INodeProvider>* _nodePin;
+
VirtualNode() {}
- VirtualNode(std::string name)
- : _name(name) {}
+public:
+ ASSIGN_GUID("CoreObjects", 1)
- virtual VirtualNode* getParent() {
- wxTreeItemId parentTreeItem = ExplorationTree::get()->GetItemParent(_mineTreeItem);
- return VirtualNodeItemData::getNode(parentTreeItem);
+ PINS_DECL
+
+ VirtualNode(wxTreeItemId mineTreeItem)
+ : _mineTreeItem(mineTreeItem) {}
+
+ /*const std::string& getName() {
+ return _name;
+ }*/
+
+ wxTreeItemId getTreeItem() {
+ return _mineTreeItem;
}
- //TODO: make it realizable in multiple chains
- virtual bool guiRealize(VirtualNode* parent) {
- //this is held by tree item and itself (via it's object chain)
- //so it have to unrealized and removed from the tree to be freed
+ void setTreeItem(wxTreeItemId mineTreeItem) {
+ _mineTreeItem = mineTreeItem;
+ }
- ASSERT(_ochain == NULL);
- ObjectChain* ochain = new ObjectChain();
- if( !ochain->addObject(RCPtr<BObject>(this)) ) { //realisation - ref count up
- delete ochain;
- return false;
- }
+ VirtualNode* getParent();
- wxTreeItemId parentTreeItem = _parent ? parent->_mineTreeItem :
- ExplorationTree::get()->GetRootItem();
- _mineTreeItem = ExplorationTree::get()->AppendItem(parentTreeItem,
- _name.c_str(), -1, -1, new VirtualNodeItemData(this) ); //ref count up
+ INodeProviderImpl* getNodeProviderImpl();
+ void VirtualNode::releaseNodeProviderImpl(INodeProviderImpl* iface);
+};
- return true;
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+//this class defines an object that can deliver given IFile interface
+class VirtualFile : public VirtualNode {
+ DECLARE_BOBJECT_CLASS(VirtualFile, VirtualNode)
+
+protected:
+ Pin<IFile>* _filePin;
+
+ int _taken;
+ IFile* _ifile;
+
+public:
+ ASSIGN_GUID("CoreObjects", 1)
+
+ PIN_DESCS
+ PIN_DESC(_filePin, PIN_DEFAULT | PIN_MULTICAST, getFile, releaseFile)
+ END_DESCS
+
+ VirtualFile(wxTreeItemId mineTreeItem, IFile* ifile)
+ : VirtualNode(mineTreeItem), _taken(0), _ifile(ifile) {}
+
+ IFile* getFile() {
+ _taken++;
+ return _ifile;
}
+ void releaseFile(IFile* iface) {
+ _taken--;
+ }
- virtual void guiUnRealize() {
- ASSERT(_ochain);
- ExplorationTree::get()->Delete(_mineTreeItem); //ref count down
- _ochain->removeObject(this); //unrealisation - ref count down
- delete _ochain;
- _ochain = NULL;
+ bool isTaken() {
+ return _taken > 0;
}
+};
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class IDirectory : public IInterface {
+public:
+ GUID_FOR(IDirectory, "CoreInterfaces", 1);
+ virtual const std::list<IFile*>& getFiles() = 0;
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+class IDirectoryImpl;
+
+class RootDirectory : public VirtualNode {
+ DECLARE_BOBJECT_CLASS(RootDirectory, VirtualNode)
+
+protected:
+ Pin<IDirectory>* _directoryPin;
+
+ typedef std::list< std::pair< std::string, std::string > > file_list;
+ file_list _files;
+
+public:
+ ASSIGN_GUID("CoreObjects", 1)
+
+ PINS_DECL
+
+ RootDirectory(wxTreeItemId mineTreeItem)
+ : VirtualNode(mineTreeItem) {}
+
+ bool addFile(std::string name, std::string fullpath);
+
+ IDirectoryImpl* getDirectoryImpl();
+ void releaseDirectoryImpl(IDirectoryImpl* iface);
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
+class DirectoryPresenter : public BObject {
+ DECLARE_BOBJECT_CLASS(DirectoryPresenter, BObject)
+
+protected:
+ Slot<IDirectory>* _directorySlot;
+ Slot<INodeProvider>* _nodeSlot;
+
+ IDirectory* _idirectory;
+ INodeProvider* _inodeprovider;
+ std::list<ObjectChain*> _kidChains;
+
+public:
+ ASSIGN_GUID("CoreObjects", 1)
+
+ SLOT_DESCS
+ SLOT_DESC(_directorySlot, SLOT_DEFAULT)
+ SLOT_DESC(_nodeSlot, SLOT_DEFAULT)
+ END_DESCS
+
+ virtual bool realize(ObjectChain* ochain);
+ virtual bool realizeKidChains();
+ virtual void unrealize(ObjectChain* ochain);
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
}
#endif //_VIRTUAL_NODE_H_
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -44,7 +44,7 @@
SLOT_DESC(_fileSlot, SLOT_DEFAULT)
END_DESCS
PIN_DESCS_EX(BMPParser)
- PIN_DESC(_imagePin, PIN_MULTICAST, getImageImpl, releaseImageImpl)
+ PIN_DESC(_imagePin, PIN_DEFAULT | PIN_MULTICAST, getImageImpl, releaseImageImpl)
END_DESCS
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -16,46 +16,32 @@
/////////////////////////////////////////////////////////////////////////////
// Concrete implementations of the interfaces
-class IStreamImpl : public IStream {
-protected:
- Common::SeekableReadStream* _stream;
- bool _ownStream;
-public:
- //inherit guid - it's a concrete implementation of an abstract interface
- IStreamImpl(Common::SeekableReadStream* stream, bool ownStream = false)
- : _stream(stream), _ownStream(ownStream) {}
- virtual Common::SeekableReadStream* getStream() {
- std::cout << "IStreamImpl::getStream()" << std::endl;
- return _stream;
- }
- virtual ~IStreamImpl() {
- if(_ownStream)
- delete _stream;
- }
-};
+IStreamImpl::IStreamImpl(Common::SeekableReadStream* stream, bool ownStream /*= false*/)
+ : _stream(stream), _ownStream(ownStream) {}
-// Limitation: can't inherit from IFile and IStreamImpl, cause I'll have to inherit
-// virtually from IStream to IStreamImpl and from IStream to IFile. It can't be done,
-// since virtual inheritance disallows casting from virtual base class (here:
-// IInterface) to a derived class (here: IFile).
-// Instead of multiple inheritance - I use encapsulation: _streamImpl member.
-class IFileImpl : public IFile {
-protected:
- std::string _name;
- IStreamImpl _streamImpl;
-public:
- //inherit guid - it's a concrete implementation of an abstract interface
- IFileImpl(std::string name, Common::SeekableReadStream* stream, bool ownStream = false)
- : _streamImpl(stream,ownStream), _name(name) {}
- virtual const std::string& getName() {
- std::cout << "IFileImpl::getName() = " << _name << std::endl;
- return _name;
- }
- virtual Common::SeekableReadStream* getStream() {
- return _streamImpl.getStream();
- }
-};
+Common::SeekableReadStream* IStreamImpl::getStream() {
+ std::cout << "IStreamImpl::getStream()" << std::endl;
+ return _stream;
+}
+IStreamImpl::~IStreamImpl() {
+ if(_ownStream)
+ delete _stream;
+}
+
+
+IFileImpl::IFileImpl(std::string name, Common::SeekableReadStream* stream, bool ownStream /*= false*/)
+ : _streamImpl(stream,ownStream), _name(name) {}
+
+const std::string& IFileImpl::getName() {
+ std::cout << "IFileImpl::getName() = " << _name << std::endl;
+ return _name;
+}
+
+Common::SeekableReadStream* IFileImpl::getStream() {
+ return _streamImpl.getStream();
+}
+
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.h 2007-07-02 01:45:25 UTC (rev 27847)
@@ -59,7 +59,38 @@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Concrete implementations of the interfaces
+class IStreamImpl : public IStream {
+protected:
+ Common::SeekableReadStream* _stream;
+ bool _ownStream;
+public:
+ //inherit guid - it's a concrete implementation of an abstract interface
+ IStreamImpl(Common::SeekableReadStream* stream, bool ownStream = false);
+ virtual Common::SeekableReadStream* getStream();
+ virtual ~IStreamImpl();
+};
+
+// Limitation: can't inherit from IFile and IStreamImpl, cause I'll have to inherit
+// virtually from IStream to IStreamImpl and from IStream to IFile. It can't be done,
+// since virtual inheritance disallows casting from virtual base class (here:
+// IInterface) to a derived class (here: IFile).
+// Instead of multiple inheritance - I use encapsulation: _streamImpl member.
+class IFileImpl : public IFile {
+protected:
+ std::string _name;
+ IStreamImpl _streamImpl;
+public:
+ //inherit guid - it's a concrete implementation of an abstract interface
+ IFileImpl(std::string name, Common::SeekableReadStream* stream, bool ownStream = false);
+ virtual const std::string& getName();
+ virtual Common::SeekableReadStream* getStream();
+};
+
+/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+
} // namespace Browser
#endif // _DISKFILEPROVIDER_H_
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp 2007-07-02 01:45:25 UTC (rev 27847)
@@ -32,6 +32,8 @@
//#include <stdlib.h>
+#include "debugmem.h"
+
namespace Browser {
// ============================================================================
Modified: scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/vc8/Browser/Browser.vcproj 2007-07-02 01:45:25 UTC (rev 27847)
@@ -172,11 +172,11 @@
>
</File>
<File
- RelativePath="..\..\src\gui\BrowserDlg.cpp"
+ RelativePath="..\..\src\gui\guicon.cpp"
>
</File>
<File
- RelativePath="..\..\src\gui\guicon.cpp"
+ RelativePath="..\..\src\gui\MainForm.cpp"
>
</File>
<File
@@ -191,6 +191,14 @@
/>
</FileConfiguration>
</File>
+ <File
+ RelativePath="..\..\src\gui\Test1.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\gui\VirtualNode.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -206,7 +214,7 @@
>
</File>
<File
- RelativePath="..\..\src\gui\BrowserDlg.h"
+ RelativePath="..\..\src\gui\ExplorationTree.h"
>
</File>
<File
@@ -217,6 +225,14 @@
RelativePath="..\..\src\gui\ImagePresenter.h"
>
</File>
+ <File
+ RelativePath="..\..\src\gui\MainForm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\gui\VirtualNode.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
Modified: scummex/branches/gsoc2007-gameresbrowser/vc8/core/ReadMe.txt
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/vc8/core/ReadMe.txt 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/vc8/core/ReadMe.txt 2007-07-02 01:45:25 UTC (rev 27847)
@@ -2,6 +2,10 @@
STATIC LIBRARY : core Project Overview
========================================================================
+Guidelines:
+When passing an BObject, pass: const RCPtr<BObject>&
+When returning an BObject, return: RCPtr<BObject>
+
Libs from wxDevCpp:
wxmsw28.lib wxmsw28_gl.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib
kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib opengl32.lib
Modified: scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout 2007-07-02 00:25:15 UTC (rev 27846)
+++ scummex/branches/gsoc2007-gameresbrowser/wxdev/Browser.layout 2007-07-02 01:45:25 UTC (rev 27847)
@@ -40,14 +40,14 @@
Open=0
Top=0
[Editor_7]
-CursorCol=22
+CursorCol=4
CursorRow=74
TopLine=74
LeftChar=1
[Editor_6]
CursorCol=1
-CursorRow=1
-TopLine=1
+CursorRow=86
+TopLine=56
LeftChar=1
[Editor_8]
CursorCol=1
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