Преглед изворни кода

Delete windowing related stuff from core

Daniele Bartolini пре 13 година
родитељ
комит
8415d4c51a
4 измењених фајлова са 0 додато и 785 уклоњено
  1. 0 62
      src/core/CoreEventArgs.h
  2. 0 488
      src/core/Delegate.h
  3. 0 99
      src/core/SignalSlot.h
  4. 0 136
      src/core/WithProperties.h

+ 0 - 62
src/core/CoreEventArgs.h

@@ -1,62 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "Types.h"
-#include "Str.h"
-
-namespace crown
-{
-
-class EventArgs
-{
-public:
-	EventArgs() { }
-	virtual ~EventArgs() { }
-};
-
-class NotifyChangeEventArgs
-{
-public:
-	NotifyChangeEventArgs(const Str& name):
-		mPropertyName(name)
-	{
-	}
-
-	virtual ~NotifyChangeEventArgs()
-	{
-	}
-
-	inline const Str& GetPropertyName() const
-	{
-		return mPropertyName;
-	}
-
-private:
-	Str mPropertyName;
-};
-
-}

+ 0 - 488
src/core/Delegate.h

@@ -1,488 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-namespace crown
-{
-
-/* Delegate with 0 arguments */
-
-template<typename TResult>
-class IDelegate
-{
-public:
-	virtual TResult Invoke() = 0;
-	virtual IDelegate<TResult>* Duplicate() = 0;
-	virtual void SetCalledObject(void* object) = 0;
-};
-
-template<typename TClass, typename TResult>
-class Delegate : public IDelegate<TResult>
-{
-public:
-	Delegate(TClass* object):
-		mObject(object)
-	{ }
-
-	~Delegate()
-	{ }
-
-	void SetCalledObject(void* object)
-	 { mObject = static_cast<TClass*>(object); }
-
-	IDelegate<TResult>* Duplicate()
-	 { return new Delegate(mObject.GetPoint32_ter()); }
-
-protected:
-	TClass* mObject;
-};
-
-/* Delegate with 1 argument */
-
-template<typename TResult, typename TArg0>
-class IDelegate1: public IDelegate<TResult>
-{
-public:
-	virtual TResult Invoke(TArg0 arg0) = 0;
-};
-
-template<typename TClass, typename TResult, typename TArg0>
-class Delegate1: public IDelegate1<TResult, TArg0>
-{
-public:
-	typedef TResult (TClass::*MethodType)(TArg0 arg0);
-
-	Delegate1(TClass* object, MethodType method):
-	 mObject(object), mMethod(method), mDefaultArg0(TArg0())
-	{ }
-
-	Delegate1(TClass* object, MethodType method, TArg0 defaultArg0):
-	 mObject(object), mMethod(method), mDefaultArg0(defaultArg0)
-	{ }
-	
-	~Delegate1()
-	{ }
-
-	void SetCalledObject(void* object)
-	 { mObject = static_cast<TClass*>(object); }
-
-	TResult Invoke();
-	TResult Invoke(TArg0 arg0);
-
-	virtual IDelegate<TResult>* Duplicate()
-	{
-		return new Delegate1(mObject.GetPoint32_ter(), mMethod, mDefaultArg0);
-	}
-
-	TArg0 GetDefaultArg0() const;
-
-protected:
-	TClass* mObject;
-	MethodType mMethod;
-	TArg0 mDefaultArg0;
-};
-
-template<typename TClass, typename TResult, typename TArg0>
-TResult Delegate1<TClass, TResult, TArg0>::Invoke()
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(mDefaultArg0);
-}
-
-template<typename TClass, typename TResult, typename TArg0>
-TResult Delegate1<TClass, TResult, TArg0>::Invoke(TArg0 arg0)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0);
-}
-
-template<typename TClass, typename TResult, typename TArg0>
-TArg0 Delegate1<TClass, TResult, TArg0>::GetDefaultArg0() const
-{
-	return mDefaultArg0;
-}
-
-
-
-/* Delegate with 2 arguments */
-
-template<typename TResult, typename TArg0, typename TArg1>
-class IDelegate2: public IDelegate1<TResult, TArg0>
-{
-public:
-	virtual TResult Invoke(TArg0 arg0, TArg1 arg1) = 0;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-class Delegate2: public IDelegate2<TResult, TArg0, TArg1>
-{
-public:
-	typedef TResult (TClass::*MethodType)(TArg0 arg0, TArg1 arg1);
-
-	Delegate2(TClass* object, MethodType method):
-	 mObject(object), mMethod(method), mDefaultArg0(TArg0()), mDefaultArg1(TArg1())
-	{ }
-
-	Delegate2(TClass* object, MethodType method, TArg0 defaultArg0, TArg1 defaultArg1):
-	 mObject(object), mMethod(method), mDefaultArg0(defaultArg0), mDefaultArg1(defaultArg1)
-	{ }
-
-	~Delegate2()
-	{ }
-
-	void SetCalledObject(void* object)
-	 { mObject = static_cast<TClass*>(object); }
-
-	TResult Invoke();
-	TResult Invoke(TArg0 arg0);
-	TResult Invoke(TArg0 arg0, TArg1 arg1);
-
-	virtual IDelegate<TResult>* Duplicate()
-	{
-		return new Delegate2(mObject.GetPoint32_ter(), mMethod, mDefaultArg0, mDefaultArg1);
-	}
-
-	TArg0 GetDefaultArg0() const;
-	TArg1 GetDefaultArg1() const;
-
-protected:
-	TClass* mObject;
-	MethodType mMethod;
-	TArg0 mDefaultArg0;
-	TArg1 mDefaultArg1;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-TResult Delegate2<TClass, TResult, TArg0, TArg1>::Invoke()
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(mDefaultArg0, mDefaultArg1);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-TResult Delegate2<TClass, TResult, TArg0, TArg1>::Invoke(TArg0 arg0)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, mDefaultArg1);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-TResult Delegate2<TClass, TResult, TArg0, TArg1>::Invoke(TArg0 arg0, TArg1 arg1)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-TArg0 Delegate2<TClass, TResult, TArg0, TArg1>::GetDefaultArg0() const
-{
-	return mDefaultArg0;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1>
-TArg1 Delegate2<TClass, TResult, TArg0, TArg1>::GetDefaultArg1() const
-{
-	return mDefaultArg1;
-}
-
-/* Delegate with 3 arguments */
-
-template<typename TResult, typename TArg0, typename TArg1, typename TArg2>
-class IDelegate3: public IDelegate2<TResult, TArg0, TArg1>
-{
-public:
-	virtual TResult Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2) = 0;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-class Delegate3: public IDelegate3<TResult, TArg0, TArg1, TArg2>
-{
-public:
-	typedef TResult (TClass::*MethodType)(TArg0 arg0, TArg1 arg1, TArg2 arg2);
-
-	Delegate3(TClass* object, MethodType method):
-	 mObject(object), mMethod(method), mDefaultArg0(TArg0()), mDefaultArg1(TArg1()), mDefaultArg2(TArg2())
-	{ }
-
-	Delegate3(TClass* object, MethodType method, TArg0 defaultArg0, TArg1 defaultArg1, TArg2 defaultArg2):
-	 mObject(object), mMethod(method), mDefaultArg0(defaultArg0), mDefaultArg1(defaultArg1), mDefaultArg2(defaultArg2)
-	{ }
-
-	~Delegate3()
-	{ }
-
-	void SetCalledObject(void* object)
-	 { mObject = static_cast<TClass*>(object); }
-
-	TResult Invoke();
-	TResult Invoke(TArg0 arg0);
-	TResult Invoke(TArg0 arg0, TArg1 arg1);
-	TResult Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2);
-
-	virtual IDelegate<TResult>* Duplicate()
-	{
-		return new Delegate3(mObject.GetPoint32_ter(), mMethod, mDefaultArg0, mDefaultArg1, mDefaultArg2);
-	}
-
-	TArg0 GetDefaultArg0() const;
-	TArg1 GetDefaultArg1() const;
-	TArg2 GetDefaultArg2() const;
-
-protected:
-	TClass* mObject;
-	MethodType mMethod;
-	TArg0 mDefaultArg0;
-	TArg1 mDefaultArg1;
-	TArg2 mDefaultArg2;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TResult Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::Invoke()
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(mDefaultArg0, mDefaultArg1, mDefaultArg2);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TResult Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::Invoke(TArg0 arg0)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, mDefaultArg1, mDefaultArg2);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TResult Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::Invoke(TArg0 arg0, TArg1 arg1)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1, mDefaultArg2);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TResult Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1, arg2);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TArg0 Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::GetDefaultArg0() const
-{
-	return mDefaultArg0;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TArg1 Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::GetDefaultArg1() const
-{
-	return mDefaultArg1;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-TArg2 Delegate3<TClass, TResult, TArg0, TArg1, TArg2>::GetDefaultArg2() const
-{
-	return mDefaultArg2;
-}
-
-/* Delegate with 4 arguments */
-
-template<typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-class IDelegate4: public IDelegate3<TResult, TArg0, TArg1, TArg2>
-{
-public:
-	virtual TResult Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3) = 0;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-class Delegate4: public IDelegate4<TResult, TArg0, TArg1, TArg2, TArg3>
-{
-public:
-	typedef TResult (TClass::*MethodType)(TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3);
-
-	Delegate4(TClass* object, MethodType method):
-	 mObject(object), mMethod(method), mDefaultArg0(TArg0()), mDefaultArg1(TArg1()), mDefaultArg2(TArg2()), mDefaultArg3(TArg3())
-	{ }
-
-	Delegate4(TClass* object, MethodType method, TArg0 defaultArg0, TArg1 defaultArg1, TArg2 defaultArg2, TArg3 defaultArg3):
-	 mObject(object), mMethod(method), mDefaultArg0(defaultArg0), mDefaultArg1(defaultArg1), mDefaultArg2(defaultArg2), mDefaultArg3(defaultArg3)
-	{ }
-
-	~Delegate4()
-	{ }
-
-	void SetCalledObject(void* object)
-	 { mObject = static_cast<TClass*>(object); }
-
-	TResult Invoke();
-	TResult Invoke(TArg0 arg0);
-	TResult Invoke(TArg0 arg0, TArg1 arg1);
-	TResult Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2);
-	TResult Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3);
-
-	virtual IDelegate<TResult>* Duplicate()
-	{
-		return new Delegate4(mObject.GetPoint32_ter(), mMethod, mDefaultArg0, mDefaultArg1, mDefaultArg2, mDefaultArg3);
-	}
-
-	TArg0 GetDefaultArg0() const;
-	TArg1 GetDefaultArg1() const;
-	TArg2 GetDefaultArg2() const;
-	TArg3 GetDefaultArg3() const;
-
-protected:
-	TClass* mObject;
-	MethodType mMethod;
-	TArg0 mDefaultArg0;
-	TArg1 mDefaultArg1;
-	TArg2 mDefaultArg2;
-	TArg3 mDefaultArg3;
-};
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TResult Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::Invoke()
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(mDefaultArg0, mDefaultArg1, mDefaultArg2, mDefaultArg3);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TResult Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::Invoke(TArg0 arg0)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, mDefaultArg1, mDefaultArg2, mDefaultArg3);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TResult Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::Invoke(TArg0 arg0, TArg1 arg1)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1, mDefaultArg2, mDefaultArg3);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TResult Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1, arg2, mDefaultArg3);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TResult Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::Invoke(TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
-{
-	if (mObject.IsNull() || mMethod == NULL)
-		return TResult();
-	return (mObject.GetPoint32_ter()->*mMethod)(arg0, arg1, arg2, arg3);
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TArg0 Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::GetDefaultArg0() const
-{
-	return mDefaultArg0;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TArg1 Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::GetDefaultArg1() const
-{
-	return mDefaultArg1;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TArg2 Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::GetDefaultArg2() const
-{
-	return mDefaultArg2;
-}
-
-template<typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-TArg3 Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>::GetDefaultArg3() const
-{
-	return mDefaultArg3;
-}
-
-/* 
- * Delegate Helper functions
- */
-
-template <typename TClass, typename TResult, typename TArg0>
-static IDelegate1<TResult, TArg0>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0))
-{
-	return new Delegate1<TClass, TResult, TArg0>(obj, method);
-}
-
-template <typename TClass, typename TResult, typename TArg0>
-static IDelegate1<TResult, TArg0>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0), TArg0 arg0)
-{
-	return new Delegate1<TClass, TResult, TArg0>(obj, method, arg0);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1>
-static IDelegate2<TResult, TArg0, TArg1>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1))
-{
-	return new Delegate2<TClass, TResult, TArg0, TArg1>(obj, method);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1>
-static IDelegate2<TResult, TArg0, TArg1>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1), TArg0 arg0, TArg1 arg1)
-{
-	return new Delegate2<TClass, TResult, TArg0, TArg1>(obj, method, arg0, arg1);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-static IDelegate3<TResult, TArg0, TArg1, TArg2>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1, TArg2))
-{
-	return new Delegate3<TClass, TResult, TArg0, TArg1, TArg2>(obj, method);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2>
-static IDelegate3<TResult, TArg0, TArg1, TArg2>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1, TArg2), TArg0 arg0, TArg1 arg1, TArg2 arg2)
-{
-	return new Delegate3<TClass, TResult, TArg0, TArg1, TArg2>(obj, method, arg0, arg1, arg2);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-static IDelegate4<TResult, TArg0, TArg1, TArg2, TArg3>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1, TArg2, TArg3))
-{
-	return new Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>(obj, method);
-}
-
-template <typename TClass, typename TResult, typename TArg0, typename TArg1, typename TArg2, typename TArg3>
-static IDelegate4<TResult, TArg0, TArg1, TArg2, TArg3>* CreateDelegate(TClass* obj, TResult (TClass::*method)(TArg0, TArg1, TArg2, TArg3), TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3)
-{
-	return new Delegate4<TClass, TResult, TArg0, TArg1, TArg2, TArg3>(obj, method, arg0, arg1, arg2, arg3);
-}
-
-
-} //namespace crown

+ 0 - 99
src/core/SignalSlot.h

@@ -1,99 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "Types.h"
-#include "List.h"
-#include "Delegate.h"
-
-namespace crown
-{
-
-/*
- * The MulticastMulticastEvent class represents an MulticastEvent. When it fires, it calls the handlers that have been added to it, passing some information arguments
- * Handlers must have the same signature of the MulticastEvent, and can be added to the MulticastEvent through the += operator
- */
-
-template <typename TSource, typename TArg1>
-class MulticastEvent
-{
-public:
-	MulticastEvent();
-	~MulticastEvent();
-
-	typedef IDelegate2<void, TSource*, TArg1> HandlerType;
-
-	void Fire(TSource* source, TArg1 arg1);
-
-	//! Register handler delegate to be called when the event fires. This operation transfers ownership
-	void operator+=(HandlerType* handler);
-
-	//! Construct and register handler delegate to be called when the event fires.
-	template <typename THandlerClass>
-	void AddHandler(THandlerClass* obj, void (THandlerClass::*handlerMethod)(TSource*, TArg1))
-	{
-		HandlerType* handler = new Delegate2<THandlerClass, void, TSource*, TArg1>(obj, handlerMethod);
-		*this += handler;
-	}
-
-private:
-	List<HandlerType*> mHandlers;
-};
-
-/* -- MulticastEvent -- */
-
-template <typename TSource, typename TArg1>
-MulticastEvent<TSource, TArg1>::MulticastEvent()
-{
-}
-
-template <typename TSource, typename TArg1>
-MulticastEvent<TSource, TArg1>::~MulticastEvent()
-{
-	for (int32_t i=0; i<mHandlers.GetSize(); i++)
-	{
-		delete mHandlers[i];
-	}
-}
-
-template <typename TSource, typename TArg1>
-void MulticastEvent<TSource, TArg1>::Fire(TSource* source, TArg1 arg1)
-{
-	for (int32_t i=0; i<mHandlers.GetSize(); i++)
-	{
-		HandlerType* handler = mHandlers[i];
-		handler->Invoke(source, arg1);
-	}
-}
-
-template <typename TSource, typename TArg1>
-void MulticastEvent<TSource, TArg1>::operator+=(HandlerType* handler)
-{
-	if (mHandlers.Find(handler) == -1)
-		mHandlers.Append(handler);
-}
-
-} //namespace crown

+ 0 - 136
src/core/WithProperties.h

@@ -1,136 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "Generic.h"
-#include "Str.h"
-#include "Dictionary.h"
-#include "Observable.h"
-#include "Property.h"
-#include "Log.h"
-#include "Weak.h"
-
-namespace crown
-{
-
-class StrSerializable
-{
-public:
-	virtual bool DeserializeFromStr(Str& input) = 0;
-	virtual Str SerializeToStr() const = 0;
-};
-
-class IWithProperties: public WeakReferenced
-{
-public:
-	virtual Generic		GetPropertyValue(const Str& name) const = 0;
-	virtual void		SetPropertyValue(const Str& name, const Generic& value) = 0;
-};
-
-class WithProperties: public Observable, public IWithProperties
-{
-public:
-	WithProperties()
-	{
-
-	}
-	
-	virtual ~WithProperties()
-	{
-		for (int32_t i=0; i<mProperties.GetSize(); i++)
-		{
-			delete mProperties[i];
-		}
-	}
-
-	//typedef Dictionary<Str, Generic> PropertiesDictionary;
-
-	virtual Generic GetPropertyValue(const Str& name) const
-	{
-		// TODO: Due to Object deletion
-//		if (name == "ToStr")
-//		{
-//			return ToStr();
-//		}
-		for(int32_t i = 0; i < mProperties.GetSize(); i++)
-		{
-			if (mProperties[i]->GetName() == name)
-			{
-				const_cast<WithProperties*>(this)->OnGetProperty(name);
-				return mProperties[i]->GetValue();
-			}
-		}
-
-		return Generic();
-	}
-
-	virtual void SetPropertyValue(const Str& name, const Generic& value)
-	{
-		for(int32_t i = 0; i < mProperties.GetSize(); i++)
-		{
-			if (mProperties[i]->GetName() == name)
-			{
-				mProperties[i]->SetValue(value);
-				OnSetProperty(name);
-				NotifyChangeEventArgs args(name);
-				NotifyChange(&args);
-				return;
-			}
-		}
-		Log::I("Property '" + name + "' not found for this object");
-	}
-
-	virtual void OnSetProperty(const Str& /*name*/)
-	{
-	}
-
-	virtual void OnGetProperty(const Str& /*name*/)
-	{
-	}
-
-	void AddProperty(Property* prop)
-	{
-		mProperties.Append(prop);
-	}
-
-	Property* GetProperty(const Str& name)
-	{
-		for(int32_t i = 0; i < mProperties.GetSize(); i++)
-		{
-			if (mProperties[i]->GetName() == name)
-			{
-				return mProperties[i];
-			}
-		}
-		return NULL;
-	}
-
-private:
-	List<Property*> mProperties;
-};
-
-}
-