Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -13,80 +13,71 @@
|
||||
#include "Gwen/Structures.h"
|
||||
|
||||
// TODO: REMOVE THIS - IT SUCKS. Template the function instead.
|
||||
#define GWEN_MCALL( fnc ) this, (Gwen::Event::Handler::Function)&fnc
|
||||
#define GWEN_MCALL(fnc) this, (Gwen::Event::Handler::Function)&fnc
|
||||
|
||||
namespace Gwen
|
||||
namespace Gwen
|
||||
{
|
||||
namespace Controls
|
||||
{
|
||||
class Base;
|
||||
}
|
||||
|
||||
namespace Event
|
||||
{
|
||||
|
||||
class Caller;
|
||||
|
||||
// A class must be derived from this
|
||||
class GWEN_EXPORT Handler
|
||||
{
|
||||
public:
|
||||
|
||||
Handler();
|
||||
virtual ~Handler();
|
||||
|
||||
void RegisterCaller( Caller* );
|
||||
void UnRegisterCaller( Caller* );
|
||||
|
||||
protected:
|
||||
|
||||
void CleanLinks();
|
||||
std::list<Caller*> m_Callers;
|
||||
|
||||
public:
|
||||
|
||||
typedef void (Handler::*Function)( Gwen::Controls::Base* pFromPanel );
|
||||
typedef void (Handler::*FunctionStr)( const Gwen::String& string );
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
class GWEN_EXPORT Caller
|
||||
{
|
||||
public:
|
||||
|
||||
Caller();
|
||||
~Caller();
|
||||
|
||||
void Call( Controls::Base* pThis );
|
||||
|
||||
template <typename T>
|
||||
void Add( Event::Handler* ob, T f )
|
||||
{
|
||||
AddInternal( ob, static_cast<Handler::Function>(f) );
|
||||
}
|
||||
|
||||
void RemoveHandler( Event::Handler* pObject );
|
||||
|
||||
protected:
|
||||
|
||||
void CleanLinks();
|
||||
void AddInternal( Event::Handler* pObject, Handler::Function pFunction );
|
||||
|
||||
struct handler
|
||||
{
|
||||
Handler::Function fnFunction;
|
||||
Event::Handler* pObject;
|
||||
};
|
||||
|
||||
std::list<handler> m_Handlers;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Controls
|
||||
{
|
||||
class Base;
|
||||
}
|
||||
|
||||
namespace Event
|
||||
{
|
||||
class Caller;
|
||||
|
||||
// A class must be derived from this
|
||||
class GWEN_EXPORT Handler
|
||||
{
|
||||
public:
|
||||
Handler();
|
||||
virtual ~Handler();
|
||||
|
||||
void RegisterCaller(Caller*);
|
||||
void UnRegisterCaller(Caller*);
|
||||
|
||||
protected:
|
||||
void CleanLinks();
|
||||
std::list<Caller*> m_Callers;
|
||||
|
||||
public:
|
||||
typedef void (Handler::*Function)(Gwen::Controls::Base* pFromPanel);
|
||||
typedef void (Handler::*FunctionStr)(const Gwen::String& string);
|
||||
};
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
class GWEN_EXPORT Caller
|
||||
{
|
||||
public:
|
||||
Caller();
|
||||
~Caller();
|
||||
|
||||
void Call(Controls::Base* pThis);
|
||||
|
||||
template <typename T>
|
||||
void Add(Event::Handler* ob, T f)
|
||||
{
|
||||
AddInternal(ob, static_cast<Handler::Function>(f));
|
||||
}
|
||||
|
||||
void RemoveHandler(Event::Handler* pObject);
|
||||
|
||||
protected:
|
||||
void CleanLinks();
|
||||
void AddInternal(Event::Handler* pObject, Handler::Function pFunction);
|
||||
|
||||
struct handler
|
||||
{
|
||||
Handler::Function fnFunction;
|
||||
Event::Handler* pObject;
|
||||
};
|
||||
|
||||
std::list<handler> m_Handlers;
|
||||
};
|
||||
|
||||
} // namespace Event
|
||||
|
||||
} // namespace Gwen
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user