[Scummvm-cvs-logs] SF.net SVN: scummvm: [27896] scummex/branches/gsoc2007-gameresbrowser/src
zbychs at users.sourceforge.net
zbychs at users.sourceforge.net
Wed Jul 4 13:09:32 CEST 2007
Revision: 27896
http://scummvm.svn.sourceforge.net/scummvm/?rev=27896&view=rev
Author: zbychs
Date: 2007-07-04 04:09:32 -0700 (Wed, 04 Jul 2007)
Log Message:
-----------
More adjusting to coding guidelines.
Modified Paths:
--------------
scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/common/scummsys.h
scummex/branches/gsoc2007-gameresbrowser/src/core/functionalex.h
scummex/branches/gsoc2007-gameresbrowser/src/core/guid.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp
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_detail.h
scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.cpp
scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.h
scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h
scummex/branches/gsoc2007-gameresbrowser/src/data/lalka.bmp
scummex/branches/gsoc2007-gameresbrowser/src/data/lisy.bmp
scummex/branches/gsoc2007-gameresbrowser/src/data/pies.bmp
scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.cpp
scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/BitmapPanel.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp
scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.h
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/CoreIntf.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -24,13 +24,13 @@
}
IStreamImpl::~IStreamImpl() {
- if(_ownStream)
+ if (_ownStream)
delete _stream;
}
IFileImpl::IFileImpl(std::string name, Common::SeekableReadStream* stream, bool ownStream /*= false*/)
- : _streamImpl(stream,ownStream), _name(name) {}
+ : _streamImpl(stream, ownStream), _name(name) {}
const std::string& IFileImpl::getName() {
return _name;
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/common/scummsys.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/common/scummsys.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/common/scummsys.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -324,9 +324,9 @@
//
#if defined(__GNUC__)
#define NORETURN __attribute__((__noreturn__))
- #define GCC_PRINTF(x,y) __attribute__((format(printf, x, y)))
+ #define GCC_PRINTF(x, y) __attribute__((format(printf, x, y)))
#else
- #define GCC_PRINTF(x,y)
+ #define GCC_PRINTF(x, y)
#endif
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/functionalex.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/functionalex.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/functionalex.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -1,6 +1,5 @@
/*
* Zbyl's extensions to STL's <functional>
-* Derived from VC++ 7.1 STL implementation.
*/
#pragma once
@@ -48,8 +47,7 @@
typedef typename _Fn1::result_type _Result;
explicit cast1st_unary_t(const _Fn1& _Left)
- : _Pfun(_Left)
- { // construct from unary_function
+ : _Pfun(_Left) { // construct from unary_function
}
_Result operator()(NArg _Left) const
@@ -63,8 +61,7 @@
// TEMPLATE FUNCTION cast1st_unary
template<class NArg, class _Fn1> inline
-cast1st_unary_t<NArg, _Fn1> cast1st_unary(const _Fn1& fn)
-{ // return a cast1st_unary_t functor adapter
+cast1st_unary_t<NArg, _Fn1> cast1st_unary(const _Fn1& fn) { // return a cast1st_unary_t functor adapter
return cast1st_unary_t<NArg, _Fn1>(fn);
}
@@ -84,8 +81,7 @@
typedef typename _Fn2::result_type _Result;
explicit cast2nd_binary_t(const _Fn2& _Left)
- : _Pfun(_Left)
- { // construct from unary_function
+ : _Pfun(_Left) { // construct from unary_function
}
_Result operator()(_Arg1 _Left, NArg _Right) const
@@ -99,8 +95,7 @@
// TEMPLATE FUNCTION cast1st_unary
template<class NArg, class _Fn2> inline
- cast2nd_binary_t<NArg, _Fn2> cast2nd_binary(const _Fn2& fn)
-{ // return a cast2nd_binary_t functor adapter
+ cast2nd_binary_t<NArg, _Fn2> cast2nd_binary(const _Fn2& fn) { // return a cast2nd_binary_t functor adapter
return cast2nd_binary_t<NArg, _Fn2>(fn);
}
@@ -117,8 +112,7 @@
typedef NResult result_type;
cast_nullary_t(const _Fn& _Func)
- : op(_Func)
- { // construct from functor
+ : op(_Func) { // construct from functor
}
result_type operator()() const
@@ -132,8 +126,7 @@
// TEMPLATE FUNCTION cast_nullary
template<class _Result, class _Fn> inline
-cast_nullary_t<_Result, _Fn> cast_nullary(const _Fn& _Func)
-{ // return a cast_nullary_t functor adapter
+cast_nullary_t<_Result, _Fn> cast_nullary(const _Fn& _Func) { // return a cast_nullary_t functor adapter
return cast_nullary_t<_Result,_Fn>(_Func);
}
@@ -146,14 +139,13 @@
class _Fn1>
class binary_unary2nd_t
: public std::binary_function<Arg1, typename _Fn1::argument_type, typename _Fn1::result_type>
-{ // functor adapter func2(_,v) = func(v)
+{ // functor adapter func2(_, v) = func(v)
public:
typedef typename _Fn1::argument_type _Arg2;
typedef typename _Fn1::result_type _Result;
explicit binary_unary2nd_t(const _Fn1& _fn)
- : fn(_fn)
- { // construct from pointer
+ : fn(_fn) { // construct from pointer
}
_Result operator()(Arg1 _Left, _Arg2 _Right) const
@@ -167,8 +159,7 @@
// TEMPLATE FUNCTION binary_unary2nd_t
template<class Arg1, class _Fn1> inline
-binary_unary2nd_t<Arg1, _Fn1> binary_unary2nd(const _Fn1& _Func)
-{ // return a binary_unary2nd_t functor adapter
+binary_unary2nd_t<Arg1, _Fn1> binary_unary2nd(const _Fn1& _Func) { // return a binary_unary2nd_t functor adapter
return binary_unary2nd_t<Arg1,_Fn1>(_Func);
}
@@ -188,8 +179,7 @@
unary_binder(const _Fn1& _Func,
const typename _Fn1::argument_type& _Left)
- : op(_Func), value(_Left)
- { // construct from functor and left operand
+ : op(_Func), value(_Left) { // construct from functor and left operand
}
result_type operator()() const
@@ -204,8 +194,7 @@
// TEMPLATE FUNCTION bind_unary
template<class _Fn1, class _Ty> inline
- unary_binder<_Fn1> bind_unary(const _Fn1& _Func, const _Ty& _Left)
-{ // return a unary_binder functor adapter
+ unary_binder<_Fn1> bind_unary(const _Fn1& _Func, const _Ty& _Left) { // return a unary_binder functor adapter
typename _Fn1::argument_type _Val(_Left);
return (unary_binder<_Fn1>(_Func, _Val));
}
@@ -231,8 +220,7 @@
trinary_binder(const _Fn3& _Func,
const typename _Fn3::third_argument_type& _Right)
- : op(_Func), value(_Right)
- { // construct from functor and right operand
+ : op(_Func), value(_Right) { // construct from functor and right operand
}
result_type operator()(const first_argument_type& _Left, const second_argument_type& _Middle) const
@@ -252,8 +240,7 @@
// TEMPLATE FUNCTION bind3rd
template<class _Fn3, class _Ty> inline
- trinary_binder<_Fn3> bind3rd(const _Fn3& _Func, const _Ty& _Right)
-{ // return a binder2nd functor adapter
+ trinary_binder<_Fn3> bind3rd(const _Fn3& _Func, const _Ty& _Right) { // return a binder2nd functor adapter
typename _Fn3::third_argument_type _Val(_Right);
return (trinary_binder<_Fn2>(_Func, _Val));
}
@@ -273,8 +260,7 @@
{ // functor adapter (*pfunc)(left, middle, right)
public:
explicit pointer_to_trinary_function(_Fn _Left)
- : _Pfun(_Left)
- { // construct from pointer
+ : _Pfun(_Left) { // construct from pointer
}
_Result operator()(_Arg1 _Left, _Arg2 _Middle, _Arg3 _Right) const
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/guid.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/guid.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/guid.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -39,18 +39,18 @@
}
bool BGUID::operator<(const BGUID& other) const {
- if(facility < other.facility) return true;
- if(facility > other.facility) return false;
- if(identifier < other.identifier) return true;
- if(identifier > other.identifier) return false;
+ if (facility < other.facility) return true;
+ if (facility > other.facility) return false;
+ if (identifier < other.identifier) return true;
+ if (identifier > other.identifier) return false;
return version < other.version;
}
bool BGUID::operator>(const BGUID& other) const {
- if(facility > other.facility) return true;
- if(facility < other.facility) return false;
- if(identifier > other.identifier) return true;
- if(identifier < other.identifier) return false;
+ if (facility > other.facility) return true;
+ if (facility < other.facility) return false;
+ if (identifier > other.identifier) return true;
+ if (identifier < other.identifier) return false;
return version > other.version;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/ochain.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -31,7 +31,7 @@
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
+ if (!res.second) //the object was already there
return false;
return true;
}
@@ -53,15 +53,15 @@
PinType* pin = obj0->get_pin(interfaceGUID);
SlotType* slot = obj1->get_slot(interfaceGUID);
- if(!pin || !slot)
+ if (!pin || !slot)
return false;
- if(slot->isConnected())
+ if (slot->isConnected())
return false;
//the slot is conected *somewhere*, so we can't connect it here
- bool cycles = check_for_cycles(obj0,obj1);
- if(cycles)
+ bool cycles = check_for_cycles(obj0, obj1);
+ if (cycles)
return false;
slot2pin.insert( slot2pin_pair(slot, pin) );
@@ -83,18 +83,18 @@
PinType* pin = obj0->get_pin(interfaceGUID);
SlotType* slot = obj1->get_slot(interfaceGUID);
- if(!pin || !slot)
+ if (!pin || !slot)
return false;
- if(!slot->isConnected())
+ if (!slot->isConnected())
return false;
//the slot is not conected *anywhere*, so it's not in our maps either
slot2pin_map::iterator i = slot2pin.find(slot);
- if(i == slot2pin.end())
+ if (i == slot2pin.end())
return false;
- if(i->second != pin)
+ if (i->second != pin)
return false;
//ASSERT(slot->getPin() == pin);
@@ -103,26 +103,26 @@
}
bool ObjectChain::isConnectedSlot(SlotType* slot) {
- if(!slot)
+ if (!slot)
return false;
- //if(!slot->isConnected())
+ //if (!slot->isConnected())
// return false;
//the slot is not conected *anywhere*, so it's not in our maps either
slot2pin_map::iterator i = slot2pin.find(slot);
- if(i == slot2pin.end())
+ if (i == slot2pin.end())
return false;
return true;
}
bool ObjectChain::isConnectedPin(PinType* pin) {
- if(!pin)
+ if (!pin)
return false;
pin2slot_map::iterator i = pin2slot.find(pin);
- if(i == pin2slot.end())
+ if (i == pin2slot.end())
return false;
return true;
@@ -180,18 +180,18 @@
//returns true if all the slots has been succesfully disconnected
//returns false on error
bool ObjectChain::disconnect_pin(PinType* pin) {
- if(!pin)
+ if (!pin)
return false;
bool res = true;
pin2slot_map::iterator i;
i = pin2slot.find(pin);
std::vector<SlotType*> slots; //cache slots, cause _disconnect messes with pin2slot
- for(; i != pin2slot.end() && i->first == pin; ++i)
+ for (; i != pin2slot.end() && i->first == pin; ++i)
slots.push_back( i->second );
std::vector<SlotType*>::iterator j;
- for(j = slots.begin(); j != slots.end(); ++j)
+ for (j = slots.begin(); j != slots.end(); ++j)
res &= _disconnect(pin, *j);
return res;
@@ -210,16 +210,14 @@
//ObjectChain)
PinSlotDescs::const_iterator i;
const PinSlotDescs& pins = obj->get_pins();
- for (i = pins.begin(); i != pins.end(); ++i)
- {
+ 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)
- {
+ for (i = slots.begin(); i != slots.end(); ++i) {
PinSlotDesc* desc = i->second;
SlotType* slot = desc->get_slot(obj.get());
res &= disconnect_slot(slot);
@@ -245,7 +243,7 @@
res &= (*i)->realize(this);
}
- if(!res)
+ if (!res)
unrealize();
return res;
@@ -287,8 +285,7 @@
PinSlotDescs::const_iterator i;
const PinSlotDescs& descs = ifPin ? obj->get_pins() : obj->get_slots();
- for (i = descs.begin(); i != descs.end(); ++i)
- {
+ for (i = descs.begin(); i != descs.end(); ++i) {
PinSlotDesc* desc = i->second;
if (ifPin && (desc->flags & PIN_DEFAULT) ) {
pin2slot_map::iterator i;
@@ -340,7 +337,7 @@
if (!slot || slot->isConnected())
continue; //no apropriate slot
- bool res = connect(RCPtr<BObject>(obj0),RCPtr<BObject>(obj1),desc->interfaceGUID);
+ bool res = connect(RCPtr<BObject>(obj0), RCPtr<BObject>(obj1), desc->interfaceGUID);
if (res) {
std::cout << " CONNECTED: " << obj1->get_GUID().identifier
<< " --> " << desc->interfaceGUID.identifier
@@ -398,7 +395,7 @@
if (!pin)
continue; //no apropriate pin
- bool res = connect(RCPtr<BObject>(obj1),RCPtr<BObject>(obj0),desc->interfaceGUID);
+ bool res = connect(RCPtr<BObject>(obj1), RCPtr<BObject>(obj0), desc->interfaceGUID);
if (res) {
std::cout << " CONNECTED: " << obj1->get_GUID().identifier
<< " --> " << desc->interfaceGUID.identifier
@@ -435,7 +432,7 @@
PinSlotDesc* desc = i->second;
SlotType* slot = desc->get_slot(obj);
PinType* pin = _that->_match_pin(slot);
- if(!pin)
+ if (!pin)
continue;
BObject* other = _that->_match_that(pin);
ASSERT(other);
@@ -471,7 +468,7 @@
i = _ranks.find(obj);
ASSERT( i != _ranks.end() );
int rank = i->second;
- if(rank > level)
+ if (rank > level)
return tree_algos::SKIP;
i->second = level;
return tree_algos::CONTINUE;
@@ -515,7 +512,7 @@
ocExpand expand(this);
object_set::const_iterator i;
for (i = objects.begin(); i != objects.end(); ++i)
- tree_algos::bfs(i->get(),visit,expand);
+ tree_algos::bfs(i->get(), visit, expand);
visit.returnOrdered(objs);
}
@@ -532,7 +529,7 @@
ocVisitCycles visit(obj1.get());
ocExpand expand(this);
- bool cycle = tree_algos::bfs(obj0.get(),visit,expand);
+ bool cycle = tree_algos::bfs(obj0.get(), visit, expand);
return cycle;
}
@@ -555,7 +552,7 @@
slot2pin.erase(slot);
pin2that.erase(pin);
pin2slot_map::iterator j;
- if(!_find_pin(pin,slot,j))
+ if (!_find_pin(pin, slot, j))
ASSERT(false);
pin2slot.erase(j);
@@ -575,14 +572,14 @@
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)
+ if (i->second == slot)
return true;
return false;
}
PinType* ObjectChain::_match_pin(SlotType* slot) {
slot2pin_map::iterator i;
- if (!_find_slot(slot,i))
+ if (!_find_slot(slot, i))
return NULL;
PinType* pin = i->second;
return pin;
@@ -600,7 +597,7 @@
/* nonsense:
SlotType* ObjectChain::_match_slot(PinType* pin, SlotType* slot) {
pin2slot_map::iterator i;
- if(!_find_pin(pin,slot,i))
+ if (!_find_pin(pin, slot, i))
return NULL;
SlotType* _slot = i->second;
return _slot;
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/oregistry.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -51,8 +51,7 @@
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();
@@ -61,7 +60,7 @@
i = _pluginsMap.find(oguid);
if (i != _pluginsMap.end()) {
res = false;
- if(!overwrite)
+ if (!overwrite)
continue;
i->second = oplug;
} else {
@@ -101,15 +100,13 @@
PinSlotDescs::const_iterator i;
const PinSlotDescs& pins = objectPlugin->get_pins();
- for (i = pins.begin(); i != pins.end(); ++i)
- {
+ 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)
- {
+ for (i = slots.begin(); i != slots.end(); ++i) {
const BGUID& slotGuid = i->first;
_slotMap.insert( PinSlotMap::value_type(slotGuid, objectGuid) );
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -74,8 +74,8 @@
namespace pinslot_detail {
- typedef std::map<const BGUID,PinSlotDesc*> the_map;
- typedef std::pair<const BGUID,PinSlotDesc*> the_pair;
+ typedef std::map<const BGUID, PinSlotDesc*> the_map;
+ typedef std::pair<const BGUID, PinSlotDesc*> the_pair;
annotation_map::annotation_map(bool _shared /*= false*/) : shared(_shared) {}
@@ -84,25 +84,25 @@
insert(_map);
}
annotation_map::~annotation_map() {
- if(shared)
+ if (shared)
return;
the_map::iterator i;
- for(i = begin(); i != end(); ++i)
+ for (i = begin(); i != end(); ++i)
delete (i->second);
}
PinSlotDesc* annotation_map::find(const BGUID& key) const {
the_map::const_iterator it = this->the_map::find(key);
- if(it != end())
+ if (it != end())
return it->second;
return NULL;
}
annotation_map& annotation_map::insert(PinSlotDesc* val) {
std::pair<the_map::iterator, bool> res =
- this->the_map::insert(the_pair(val->interfaceGUID,val));
- if(!res.second) { //there is an element with the same BGUID
- if(res.first->second)
+ this->the_map::insert(the_pair(val->interfaceGUID, val));
+ if (!res.second) { //there is an element with the same BGUID
+ if (res.first->second)
delete res.first->second; //get rid of it...
res.first->second = val; //...and overwrite
}
@@ -117,7 +117,7 @@
annotation_map& annotation_map::insert_copy(const annotation_map& cont) {
ASSERT(this->empty());
annotation_map::const_iterator i;
- for(i = cont.begin(); i != cont.end(); ++i)
+ for (i = cont.begin(); i != cont.end(); ++i)
this->the_map::insert( the_pair( i->first, i->second->copy() ) );
return *this;
}
@@ -132,14 +132,12 @@
void BObject::init_pins_slots() {
PinSlotDescs::const_iterator i;
const PinSlotDescs& pdescs = get_pins();
- for(i = pdescs.begin(); i != pdescs.end(); ++i)
- {
+ for (i = pdescs.begin(); i != pdescs.end(); ++i) {
PinSlotDesc* desc = i->second;
desc->makePinSlot(this);
}
const PinSlotDescs& sdescs = get_slots();
- for(i = sdescs.begin(); i != sdescs.end(); ++i)
- {
+ for (i = sdescs.begin(); i != sdescs.end(); ++i) {
PinSlotDesc* desc = i->second;
desc->makePinSlot(this);
}
@@ -149,14 +147,12 @@
void BObject::delete_pins_slots() {
PinSlotDescs::const_iterator i;
const PinSlotDescs& pdescs = get_pins();
- for(i = pdescs.begin(); i != pdescs.end(); ++i)
- {
+ for (i = pdescs.begin(); i != pdescs.end(); ++i) {
PinSlotDesc* desc = i->second;
delete desc->getPinSlot(this);
}
const PinSlotDescs& sdescs = get_slots();
- for(i = sdescs.begin(); i != sdescs.end(); ++i)
- {
+ for (i = sdescs.begin(); i != sdescs.end(); ++i) {
PinSlotDesc* desc = i->second;
delete desc->getPinSlot(this);
}
@@ -172,7 +168,7 @@
PinSlotType* BObject::get_pinSlot(const BGUID& interfaceGUID, const PinSlotDescs& descs) {
PinSlotDesc* desc = descs.find(interfaceGUID);
- if(!desc)
+ if (!desc)
return NULL;
return desc->getPinSlot(this);
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -180,7 +180,7 @@
return pinSlotGet(that);
}
virtual PinSlotDesc* copy() const {
- return new PinSlotDescImpl<GD,FD>(*this, pinSlotGet, pinSlotFactory);
+ return new PinSlotDescImpl<GD, FD>(*this, pinSlotGet, pinSlotFactory);
}
};
@@ -205,8 +205,7 @@
RD releaseDelegate;
DelegatingPin(const GD& gd, const RD& rd) :
getDelegate(gd),
- releaseDelegate(rd)
- {}
+ releaseDelegate(rd) {}
virtual I* getInterface() {
return getDelegate();
}
@@ -226,7 +225,7 @@
template<typename I, int flags, typename GD, typename RD>
Pin<I>* makeDelegatingPin(const GD& gd, const RD& rd) {
- return new DelegatingPin<I,flags,GD,RD>(gd,rd);
+ return new DelegatingPin<I, flags, GD, RD>(gd, rd);
}
/////////////////////////////////////////////////////////////////////////////
@@ -246,16 +245,16 @@
ASSERT(pin == NULL && iface == NULL);
}
virtual I* getInterface() {
- if(!pin)
+ if (!pin)
return NULL;
- if(!iface)
+ if (!iface)
iface = pin->getInterface();
return iface;
}
virtual void releaseInterface() {
- if(!pin)
+ if (!pin)
return;
- if(!iface)
+ if (!iface)
return;
pin->releaseInterface(iface);
//pin = NULL;
@@ -320,8 +319,7 @@
BObjectDesc(std::string name, const BGUID& objectGUID, int flags,
const PinSlotDescs& pinDescs, const PinSlotDescs& slotDescs)
: _name(name), _objectGUID(objectGUID), _flags(flags),
- _pinDescs(pinDescs), _slotDescs(slotDescs)
- {}
+ _pinDescs(pinDescs), _slotDescs(slotDescs) {}
int get_flags() const {
return _flags;
@@ -390,7 +388,7 @@
//invoked to initialize the object in the ObjectChain
//realize can query the ObjectChain (the object is already a member of it)
virtual bool realize(ObjectChain* ochain) {
- if(_realized)
+ if (_realized)
return false;
_ochain = ochain;
_realized = true;
@@ -400,7 +398,7 @@
//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) {
- if(!isRealized(ochain))
+ if (!isRealized(ochain))
return;
_ochain = NULL;
_realized = false;
@@ -446,14 +444,14 @@
/*template<typename I>
I* getInterface() {
Pin<I>* pin = get_pin<I>();
- if(!pin)
+ if (!pin)
return NULL;
return pin->getInterface();
}
template<typename I>
void releaseInterface(I* iface) {
Pin<I>* pin = get_pin<I>();
- if(!pin)
+ if (!pin)
return;
pin->releaseInterface(iface);
}*/
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot_detail.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot_detail.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/pinslot_detail.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -85,7 +85,7 @@
PinSlotDescs(true).insert_copy(super_class::static_pins())
-#define PIN_DESC(pin,flags,getFun,relFun) \
+#define PIN_DESC(pin, flags, getFun, relFun) \
.insert( \
makePinDesc<flags | IS_PIN>( \
#pin, \
@@ -97,16 +97,16 @@
//iRel is a name of the concrete interface, that can be freed with it's
//release() method
-#define PIN_DESC_r(pin,flags,getFun,iRel) \
+#define PIN_DESC_r(pin, flags, getFun, iRel) \
.insert( \
- makePinDesc<flags | IS_PIN,iRel>( \
+ makePinDesc<flags | IS_PIN, iRel>( \
#pin, \
&this_class::pin, \
&this_class::getFun \
) \
)
-#define SLOT_DESC(pin,flags) \
+#define SLOT_DESC(pin, flags) \
.insert( \
makeSlotDesc<flags | IS_SLOT>( \
#pin, \
@@ -147,7 +147,7 @@
void operator()(BObject* that) const
{
(static_cast<T*>(that)) ->* pin =
- makeDelegatingPin<I,flags>(
+ makeDelegatingPin<I, flags>(
/*cast_nullary<I*>*/( bind_unary(gd, static_cast<T*>(that)) ),
/*cast1st_unary<I*>*/( bind1st(rd, static_cast<T*>(that)) )
);
@@ -155,8 +155,8 @@
};
template<int flags, typename I, typename T, typename GD, typename RD>
-PinMaker<flags,I,T,GD,RD> makePin(Pin<I>* T::*_pin, const GD& _gd, const RD& _rd) {
- return PinMaker<flags,I,T,GD,RD>(_pin,_gd,_rd);
+PinMaker<flags, I, T, GD, RD> makePin(Pin<I>* T::*_pin, const GD& _gd, const RD& _rd) {
+ return PinMaker<flags, I, T, GD, RD>(_pin,_gd,_rd);
}
template<int flags, typename I, typename T>
@@ -167,13 +167,13 @@
void operator()(BObject* that) const
{
(static_cast<T*>(that)) ->* slot =
- new SlotImpl<I,T,flags>();
+ new SlotImpl<I, T, flags>();
}
};
template<int flags, typename I, typename T>
-SlotMaker<flags,I,T> makeSlot(Slot<I>* T::*_slot) {
- return SlotMaker<flags,I,T>(_slot);
+SlotMaker<flags, I, T> makeSlot(Slot<I>* T::*_slot) {
+ return SlotMaker<flags, I, T>(_slot);
}
template<typename I, class T, template<typename I2> class PS>
@@ -188,13 +188,13 @@
};
template<typename I, typename T>
-PinSlotAccessor<I,T,Pin> accessPin(Pin<I>* T::*_pin) {
- return PinSlotAccessor<I,T,Pin>(_pin);
+PinSlotAccessor<I, T, Pin> accessPin(Pin<I>* T::*_pin) {
+ return PinSlotAccessor<I, T, Pin>(_pin);
}
template<typename I, typename T>
-PinSlotAccessor<I,T,Slot> accessSlot(Slot<I>* T::*_slot) {
- return PinSlotAccessor<I,T,Slot>(_slot);
+PinSlotAccessor<I, T, Slot> accessSlot(Slot<I>* T::*_slot) {
+ return PinSlotAccessor<I, T, Slot>(_slot);
}
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/plugin_detail.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -14,11 +14,11 @@
/////////////////////////////////////////////////////////////////////////////
// Helper macros
-#define JOIN_TOKENS(x,y) JOIN_TOKENS2(x,y)
-#define JOIN_TOKENS2(x,y) x ## y
+#define JOIN_TOKENS(x, y) JOIN_TOKENS2(x, y)
+#define JOIN_TOKENS2(x, y) x ## y
#define GENERATE_UNIQUE_IDENTIFIER JOIN_TOKENS(z__unique_id_, __LINE__)
#define GENERATE_UNIQUE_IDENTIFIER_SUB(subname) \
- JOIN_TOKENS(GENERATE_UNIQUE_IDENTIFIER, JOIN_TOKENS(_,subname))
+ JOIN_TOKENS(GENERATE_UNIQUE_IDENTIFIER, JOIN_TOKENS(_, subname))
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -35,30 +35,26 @@
RCObject::RCObject(const RCObject&)
: refCount(0), shareable(true) {}
-RCObject& RCObject::operator=(const RCObject&)
-{
+RCObject& RCObject::operator=(const RCObject&) {
return *this;
}
RCObject::~RCObject() {}
-void RCObject::addReference()
-{
+void RCObject::addReference() {
if (++refCount == 1) {
initialize();
}
}
-void RCObject::removeReference()
-{
+void RCObject::removeReference() {
if (--refCount == 0) {
destroy();
delete this;
}
}
-void RCObject::markUnshareable()
-{
+void RCObject::markUnshareable() {
shareable = false;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/rcobject.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -123,8 +123,7 @@
};
template<class T>
-void RCPtr<T>::init()
-{
+void RCPtr<T>::init() {
if (pointee == 0) return;
ASSERT( pointee->isShareable() );
@@ -137,35 +136,30 @@
template<class T>
RCPtr<T>::RCPtr(T* realPtr)
-: pointee(realPtr)
-{
+: pointee(realPtr) {
init();
}
template<class T>
RCPtr<T>::RCPtr(const RCPtr& rhs)
-: pointee(rhs.pointee)
-{
+: pointee(rhs.pointee) {
init();
}
template<class T>
template<class S>
RCPtr<T>::RCPtr(const RCPtr<S>& rhs)
-: pointee(rhs.pointee)
-{
+: pointee(rhs.pointee) {
init();
}
template<class T>
-RCPtr<T>::~RCPtr()
-{
+RCPtr<T>::~RCPtr() {
if (pointee) pointee->removeReference();
}
template<class T>
-RCPtr<T>& RCPtr<T>::operator=(const RCPtr& rhs)
-{
+RCPtr<T>& RCPtr<T>::operator=(const RCPtr& rhs) {
if (pointee != rhs.pointee) { // this code was modified
T *oldPointee = pointee; // for the book's 10th
// printing
@@ -180,8 +174,7 @@
template<class T>
template<class S>
-RCPtr<T>& RCPtr<T>::operator=(const RCPtr<S>& rhs)
-{
+RCPtr<T>& RCPtr<T>::operator=(const RCPtr<S>& rhs) {
if (pointee != rhs.pointee) { // this code was modified
T *oldPointee = pointee; // for the book's 10th
// printing
@@ -214,38 +207,31 @@
// taken from boost intrusive_ptr, and modified
-template<class T> inline bool operator==(RCPtr<T> const & a, RCPtr<T> const & b)
-{
+template<class T> inline bool operator==(RCPtr<T> const & a, RCPtr<T> const & b) {
return a.get() == b.get();
}
-template<class T> inline bool operator!=(RCPtr<T> const & a, RCPtr<T> const & b)
-{
+template<class T> inline bool operator!=(RCPtr<T> const & a, RCPtr<T> const & b) {
return a.get() != b.get();
}
-/*template<class T> inline bool operator==(RCPtr<T> const & a, T * b)
-{
+/*template<class T> inline bool operator==(RCPtr<T> const & a, T * b) {
return a.get() == b;
}
-template<class T> inline bool operator!=(RCPtr<T> const & a, T * b)
-{
+template<class T> inline bool operator!=(RCPtr<T> const & a, T * b) {
return a.get() != b;
}
-template<class T> inline bool operator==(T * a, RCPtr<T> const & b)
-{
+template<class T> inline bool operator==(T * a, RCPtr<T> const & b) {
return a == b.get();
}
-template<class T> inline bool operator!=(T * a, RCPtr<T> const & b)
-{
+template<class T> inline bool operator!=(T * a, RCPtr<T> const & b) {
return a != b.get();
}*/
-template<class T> inline bool operator<(RCPtr<T> const & a, RCPtr<T> const & b)
-{
+template<class T> inline bool operator<(RCPtr<T> const & a, RCPtr<T> const & b) {
return std::less<T *>()(a.get(), b.get());
}
@@ -277,26 +263,22 @@
friend std::ostream& operator<<(std::ostream& stream, const String& string);
};
-void String::StringValue::init(const char *initValue)
-{
+void String::StringValue::init(const char *initValue) {
using namespace std;
data = new char[strlen(initValue) + 1];
strcpy(data, initValue);
}
-String::StringValue::StringValue(const char *initValue)
-{
+String::StringValue::StringValue(const char *initValue) {
init(initValue);
}
-String::StringValue::StringValue(const StringValue& rhs)
-{
+String::StringValue::StringValue(const StringValue& rhs) {
init(rhs.data);
}
-String::StringValue::~StringValue()
-{
+String::StringValue::~StringValue() {
delete [] data;
}
@@ -309,8 +291,7 @@
return value->data[index];
}
-char& String::operator[](int index)
-{
+char& String::operator[](int index) {
if (value->isShared()) {
value = new StringValue(value->data);
}
@@ -320,8 +301,7 @@
return value->data[index];
}
-std::ostream& operator<<(std::ostream& stream, const String& string)
-{
+std::ostream& operator<<(std::ostream& stream, const String& string) {
return stream << string.value->data;
}
@@ -359,8 +339,7 @@
};
template<class T>
-void RCIPtr<T>::init()
-{
+void RCIPtr<T>::init() {
if (counter->isShareable() == false) {
T *oldValue = counter->pointee;
counter = new CountHolder;
@@ -372,24 +351,20 @@
template<class T>
RCIPtr<T>::RCIPtr(T* realPtr)
-: counter(new CountHolder)
-{
+: counter(new CountHolder) {
counter->pointee = realPtr;
init();
}
template<class T>
RCIPtr<T>::RCIPtr(const RCIPtr& rhs)
-: counter(rhs.counter)
-{ init(); }
+: counter(rhs.counter) { init(); }
template<class T>
-RCIPtr<T>::~RCIPtr()
-{ counter->removeReference(); }
+RCIPtr<T>::~RCIPtr() { counter->removeReference(); }
template<class T>
-RCIPtr<T>& RCIPtr<T>::operator=(const RCIPtr& rhs)
-{
+RCIPtr<T>& RCIPtr<T>::operator=(const RCIPtr& rhs) {
if (counter != rhs.counter) {
counter->removeReference();
counter = rhs.counter;
@@ -419,14 +394,12 @@
Widget(const Widget& rhs): value(rhs.value) {}
~Widget() {}
- Widget& operator=(const Widget& rhs)
- {
+ Widget& operator=(const Widget& rhs) {
value = rhs.value;
return *this;
}
- void doThis()
- { value = -1; }
+ void doThis() { value = -1; }
int showThat() const
{ return value; }
@@ -448,8 +421,7 @@
RCWidget(int size)
: value(new Widget(size)) {}
- void doThis()
- {
+ void doThis() {
if (value.getRCObject().isShared()) { // do COW if
value = new Widget(*value); // Widget is shared
}
@@ -467,8 +439,7 @@
/******************************************************************************
* Functions to perform VERY simple test of the above. *
******************************************************************************
-void testRCPtr()
-{
+void testRCPtr() {
String s1 = "String with no changes.";
String s2(s1);
@@ -478,8 +449,7 @@
std::cout << s2 << '\n'; // prints "String with changes."
}
-void testRCIPtr()
-{
+void testRCIPtr() {
RCWidget w1(10);
RCWidget w2(w1);
@@ -489,8 +459,7 @@
std::cout << w2.showThat() << '\n'; // prints -1
}
-int main()
-{
+int main() {
testRCPtr();
testRCIPtr();
Modified: scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/core/treealgos.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -85,23 +85,21 @@
};
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, 0);
- while(true)
- {
- if(fringe.empty())
+ while(true) {
+ if (fringe.empty())
return false;
Node node(fringe.front());
int level(fringe.level());
fringe.pop();
int res = visitFun(node, level);
- if(res == DONE)
+ if (res == DONE)
return true;
- if(res != SKIP)
+ if (res != SKIP)
expandFun(node, level, fringe);
}
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/data/lalka.bmp
===================================================================
(Binary files differ)
Modified: scummex/branches/gsoc2007-gameresbrowser/src/data/lisy.bmp
===================================================================
(Binary files differ)
Modified: scummex/branches/gsoc2007-gameresbrowser/src/data/pies.bmp
===================================================================
(Binary files differ)
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/BrowserApp.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -20,8 +20,7 @@
IMPLEMENT_APP(BrowserDlgApp)
-bool BrowserDlgApp::OnInit()
-{
+bool BrowserDlgApp::OnInit() {
RedirectIOToConsole();
/*BrowserDlg* dialog = new BrowserDlg(NULL);
SetTopWindow(dialog);
@@ -32,7 +31,6 @@
return true;
}
-int BrowserDlgApp::OnExit()
-{
+int BrowserDlgApp::OnExit() {
return 0;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/DirectoryPresenter.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -51,7 +51,7 @@
}
void DirectoryPresenter::unrealize(ObjectChain* ochain) {
- if(!isRealized(ochain))
+ if (!isRealized(ochain))
return;
ExplorationTree::get()->unregisterDirectoryPresenter(this);
@@ -129,7 +129,7 @@
void DirectoryPresenter::expand() {
- if(_expanded)
+ if (_expanded)
return;
_expanded = true;
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ExplorationTree.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -246,7 +246,7 @@
if (activatedNode != _activeNode)
nodeDeactivate();
_activeNode = activatedNode;
- if(!_activeNode)
+ if (!_activeNode)
return;
std::list<PanelInfo*> pinfos = _panelMap->getPanelsFor(activatedNode);
@@ -258,7 +258,7 @@
void ExplorationTree::itemActivated(wxTreeItemId item) {
VirtualNode* node = VirtualNodeItemData::getNode(item);
- if(node)
+ if (node)
nodeActivated(node);
}
@@ -277,7 +277,7 @@
}
void ExplorationTree::nodeExpanded(VirtualNode* expandedNode) {
- if(!expandedNode)
+ if (!expandedNode)
return;
DirectoryPresenter* dirPresenter = _dirMap->getDirFor(expandedNode);
@@ -286,7 +286,7 @@
void ExplorationTree::itemExpanded(wxTreeItemId item) {
VirtualNode* node = VirtualNodeItemData::getNode(item);
- if(node)
+ if (node)
nodeExpanded(node);
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/FilePresenter.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -37,7 +37,7 @@
std::string FilePresenter::getPanelTitle() {
IFile* ifile = _fileSlot->getInterface();
- if(!ifile) {
+ if (!ifile) {
std::cout << "FilePresenter::getPanelTitle(): could not get IFile interface" << std::endl;
return "error reading file";
}
@@ -53,7 +53,7 @@
std::cout << "FilePresenter::panelActivate()" << std::endl;
IFile* ifile = _fileSlot->getInterface();
- if(!ifile) {
+ if (!ifile) {
std::cout << "FilePresenter::panelActivate(): could not get IFile interface" << std::endl;
return;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/ImagePresenter.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -39,7 +39,7 @@
: _bitmap(NULL), _bmpPanel(NULL) {}
ImagePresenter::~ImagePresenter() {
- if(_bitmap)
+ if (_bitmap)
delete _bitmap;
}
@@ -50,9 +50,9 @@
void ImagePresenter::panelActivate(wxPanel* panel) {
std::cout << "ImagePresenter::panelActivate()" << std::endl;
- if(!_bitmap) {
+ if (!_bitmap) {
IImage* iimage = _imageSlot->getInterface();
- if(!iimage) {
+ if (!iimage) {
std::cout << " -- could not get IImage interface" << std::endl;
return;
}
@@ -72,7 +72,7 @@
void ImagePresenter::panelDeactivate() {
std::cout << "ImagePresenter::panelDeactivate()" << std::endl;
- if(_bmpPanel) {
+ if (_bmpPanel) {
_bmpPanel->Destroy();
_bmpPanel = NULL;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/MainForm.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -36,7 +36,7 @@
//Add Custom Events only in the appropriate block.
//Code added in other places will be removed by wxDev-C++
////Event Table Start
-BEGIN_EVENT_TABLE(MainForm,wxFrame)
+BEGIN_EVENT_TABLE(MainForm, wxFrame)
////Manual Code Start
////Manual Code End
@@ -45,14 +45,13 @@
EVT_MENU(ID_TEST1, MainForm::OnTest1)
EVT_MENU(ID_TEST1_CLEANUP, MainForm::OnTest1Cleanup)
- EVT_TREE_ITEM_ACTIVATED(ID_BROWSERTREE,MainForm::browserTreeItemActivated)
- EVT_TREE_ITEM_EXPANDING(ID_BROWSERTREE,MainForm::browserTreeItemExpanding)
+ EVT_TREE_ITEM_ACTIVATED(ID_BROWSERTREE, MainForm::browserTreeItemActivated)
+ EVT_TREE_ITEM_EXPANDING(ID_BROWSERTREE, MainForm::browserTreeItemExpanding)
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)
-{
+: wxFrame(parent, id, title, position, size, style) {
CreateGUIControls();
SetClientSize( wxSize(640, 480) );
GetSizer()->SetMinSize(640, 480);
@@ -66,15 +65,13 @@
leak[0] = 'L'; leak[1] = 'E'; leak[2] = 'A'; leak[3] = 'K'; leak[4] = '\0';
}
-MainForm::~MainForm()
-{
+MainForm::~MainForm() {
ExplorationTree::release();
FileTypeRegistry::release();
ObjectRegistry::release();
}
-void MainForm::CreateGUIControls()
-{
+void MainForm::CreateGUIControls() {
//Do not add custom code between
//GUI Items Creation Start and GUI Items Creation End
//wxDev-C++ designer will remove them.
@@ -85,20 +82,20 @@
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);
+ 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(185,382), wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT);
- browserTree->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
+ 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")));
+ mainPanel = new wxPanel(WxSplitterWindow1, ID_MAINPANEL, wxPoint(200, 8), wxSize(363, 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->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"));
@@ -113,11 +110,11 @@
mainPanel->SetSizer(WxBoxSizer2);
mainPanel->SetAutoLayout(true);
- browserNotebook = new wxNotebook(mainPanel, ID_BROWSERNOTEBOOK, wxPoint(34,45),wxSize(309,337));
- browserNotebook->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, wxT("Tahoma")));
- WxBoxSizer2->Add(browserNotebook,1,wxEXPAND | wxALL,5);
+ browserNotebook = new wxNotebook(mainPanel, ID_BROWSERNOTEBOOK, wxPoint(34, 45), wxSize(309, 337));
+ browserNotebook->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma")));
+ WxBoxSizer2->Add(browserNotebook, 1, wxEXPAND | wxALL, 5);
- WxSplitterWindow1->SplitVertically(browserTree,mainPanel,329);
+ WxSplitterWindow1->SplitVertically(browserTree, mainPanel, 329);
SetTitle(wxT("Game Resource Browser"));
SetIcon(wxNullIcon);
@@ -130,31 +127,27 @@
////GUI Items Creation End
}
-void MainForm::OnClose(wxCloseEvent& event)
-{
+void MainForm::OnClose(wxCloseEvent& event) {
Destroy();
}
/*
* OnExit
*/
-void MainForm::OnExit(wxCommandEvent& event)
-{
+void MainForm::OnExit(wxCommandEvent& event) {
Close(true);
}
/*
* browserTreeItemActivated
*/
-void MainForm::browserTreeItemActivated(wxTreeEvent& event)
-{
+void MainForm::browserTreeItemActivated(wxTreeEvent& event) {
ExplorationTree::get()->itemActivated(event.GetItem());
}
/*
* browserTreeItemExpanding
*/
-void MainForm::browserTreeItemExpanding(wxTreeEvent& event)
-{
+void MainForm::browserTreeItemExpanding(wxTreeEvent& event) {
ExplorationTree::get()->itemExpanded(event.GetItem());
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/PanelProvider.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -42,7 +42,7 @@
}
void PanelProvider::unrealize(ObjectChain* ochain) {
- if(!isRealized(ochain))
+ if (!isRealized(ochain))
return;
ExplorationTree::get()->unregisterPanelProvider(this);
Modified: scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/gui/Test1.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -53,8 +53,7 @@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-void MainForm::OnTest1(wxCommandEvent& event)
-{
+void MainForm::OnTest1(wxCommandEvent& event) {
OnTest1Cleanup(event);
wxTreeItemId rootItem = ExplorationTree::_getTree()->
@@ -95,8 +94,7 @@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-void MainForm::OnTest1Cleanup(wxCommandEvent& event)
-{
+void MainForm::OnTest1Cleanup(wxCommandEvent& event) {
ExplorationTree::_getTree()->DeleteAllItems();
ObjectChain* rootChain = ExplorationTree::get()->getRootObjectChain();
rootChain->removeAllObjects();
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BMPParser.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -29,14 +29,14 @@
std::cout << "BMPParser::getImageImpl(): " << std::endl;
IFile* ifile = _fileSlot->getInterface();
- if(!ifile)
+ if (!ifile)
return NULL;
ifile->getStream()->seek(0, SEEK_SET);
wxInputStream* input = new wxScummInputStream(ifile->getStream());
wxImage* image = new wxImage();
- bool res = image->LoadFile(*input,wxBITMAP_TYPE_BMP);
+ bool res = image->LoadFile(*input, wxBITMAP_TYPE_BMP);
delete input;
_fileSlot->releaseInterface();
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/BitmapPanel.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/BitmapPanel.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/BitmapPanel.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -23,20 +23,17 @@
/////////////////////////////////////////////////////////////////////////////
BitmapPanel::BitmapPanel(wxPanel *parent, const wxBitmap& bitmap)
- : wxPanel(parent), _bitmap(bitmap)
-{
+ : wxPanel(parent), _bitmap(bitmap) {
SetClientSize(bitmap.GetWidth(), bitmap.GetHeight());
}
-void BitmapPanel::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
+void BitmapPanel::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc( this );
dc.DrawBitmap( _bitmap, 0, 0, true /* use mask */ );
}
//TODO: draw a checkboard
-/*void BitmapPanel::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
-{
+/*void BitmapPanel::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) {
// do nothing here to be able to see how transparent images are shown
}*/
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/Directories.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -268,7 +268,7 @@
}
void DiskDirectory::unrealize(ObjectChain* ochain) {
- if(!isRealized(ochain))
+ if (!isRealized(ochain))
return;
ExplorationTree::get()->unregisterDirectoryPresenter(this);
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/DiskFileProvider.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -24,7 +24,7 @@
std::cout << "DiskFileProvider::getFileImpl(): " << _diskFileName << std::endl;
Common::SimpleFile* file = new Common::SimpleFile();
bool res = file->open(_diskFileName.c_str());
- if(!res) {
+ if (!res) {
delete file;
return NULL;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/FileTypeRecognizer.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -35,7 +35,7 @@
ResolvedFileTypeParsers BinaryFileTypeParserResolver::resolve(const BGUID& fileType) {
guid_list parsers;
- if(fileType != binaryFileType())
+ if (fileType != binaryFileType())
return ResolvedFileTypeParsers::NoParsers;
//FIXME: this is temporary
@@ -60,7 +60,7 @@
return RecognizedFileType::NotRecognized;
IFile* ifile = _fileSlot->getInterface();
- if(!ifile)
+ if (!ifile)
return RecognizedFileType::NotRecognized;
RecognizedFileType recognized = doRecognize(file, ifile);
@@ -93,7 +93,7 @@
ResolvedFileTypeParsers BMPFileTypeParserResolver::resolve(const BGUID& fileType) {
guid_list parsers;
- if(fileType != bmpFileType())
+ if (fileType != bmpFileType())
return ResolvedFileTypeParsers(NO_PARSERS, parsers);
//FIXME: this is temporary
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/GUIIntf.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -26,7 +26,7 @@
}
IImageImpl::~IImageImpl() {
- if(_ownImage)
+ if (_ownImage)
delete _image;
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.cpp 2007-07-04 11:09:32 UTC (rev 27896)
@@ -4,7 +4,7 @@
// Author: Guilhem Lavaux
// Modified by: VZ (23.11.00): general code review
// Created: 04/01/98
-// RCS-ID: $Id: mstream.cpp,v 1.39 2006/05/03 21:50:25 ABX Exp $
+// RCS-ID: $Id: mstream.cpp, v 1.39 2006/05/03 21:50:25 ABX Exp $
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -40,14 +40,12 @@
// implementation
// ============================================================================
-wxScummInputStream::~wxScummInputStream()
-{
- if(_ownStream)
+wxScummInputStream::~wxScummInputStream() {
+ if (_ownStream)
delete _stream;
}
-char wxScummInputStream::Peek()
-{
+char wxScummInputStream::Peek() {
size_t pos = _stream->pos();
if ( pos == _size ) {
m_lasterror = wxSTREAM_READ_ERROR;
@@ -55,13 +53,13 @@
}
char c = _stream->readSByte();
- if(_stream->ioFailed()) {
+ if (_stream->ioFailed()) {
m_lasterror = wxSTREAM_READ_ERROR;
return 0;
}
_stream->seek(-1, SEEK_CUR);
- if(_stream->ioFailed()) {
+ if (_stream->ioFailed()) {
m_lasterror = wxSTREAM_READ_ERROR;
return 0;
}
@@ -69,18 +67,16 @@
return c;
}
-size_t wxScummInputStream::OnSysRead(void *buffer, size_t nbytes)
-{
+size_t wxScummInputStream::OnSysRead(void *buffer, size_t nbytes) {
size_t pos = _stream->pos(); //m_i_streambuf->GetIntPosition();
- if ( pos == _size )
- {
+ if ( pos == _size ) {
m_lasterror = wxSTREAM_EOF;
return 0;
}
uint32 nread = _stream->read(buffer, (uint32)nbytes);
- if(_stream->ioFailed()) {
+ if (_stream->ioFailed()) {
m_lasterror = wxSTREAM_READ_ERROR;
return 0;
}
@@ -89,16 +85,15 @@
return nread;
}
-wxFileOffset wxScummInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
-{
+wxFileOffset wxScummInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) {
int whence = SEEK_SET;
- if(mode == wxFromCurrent)
+ if (mode == wxFromCurrent)
whence = SEEK_CUR;
else
- if(mode == wxFromEnd)
+ if (mode == wxFromEnd)
whence = SEEK_END;
- _stream->seek(pos,whence);
+ _stream->seek(pos, whence);
return _stream->pos();
}
Modified: scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.h
===================================================================
--- scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.h 2007-07-04 10:39:13 UTC (rev 27895)
+++ scummex/branches/gsoc2007-gameresbrowser/src/plugins/wx2scstream.h 2007-07-04 11:09:32 UTC (rev 27896)
@@ -4,7 +4,7 @@
// Author: Guilhem Lavaux
// Modified by:
// Created: 11/07/98
-// RCS-ID: $Id: mstream.h,v 1.34 2006/04/14 16:52:56 ABX Exp $
+// RCS-ID: $Id: mstream.h, v 1.34 2006/04/14 16:52:56 ABX Exp $
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
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