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:
@@ -15,68 +15,67 @@
|
||||
|
||||
namespace Gwen
|
||||
{
|
||||
namespace Hook
|
||||
namespace Hook
|
||||
{
|
||||
class GWEN_EXPORT BaseHook
|
||||
{
|
||||
public:
|
||||
virtual bool OnControlClicked(Gwen::Controls::Base*, int /*iMouseX*/, int /*iMouseY*/) { return false; };
|
||||
};
|
||||
|
||||
typedef std::list<BaseHook*> HookList;
|
||||
|
||||
GWEN_EXPORT HookList& GetHookList();
|
||||
|
||||
GWEN_EXPORT void AddHook(BaseHook* pHook);
|
||||
GWEN_EXPORT void RemoveHook(BaseHook* pHook);
|
||||
|
||||
template <typename fnc>
|
||||
bool CallHook(fnc f)
|
||||
{
|
||||
for (HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it)
|
||||
{
|
||||
class GWEN_EXPORT BaseHook
|
||||
{
|
||||
public:
|
||||
|
||||
virtual bool OnControlClicked( Gwen::Controls::Base*, int /*iMouseX*/, int /*iMouseY*/ ){ return false; };
|
||||
};
|
||||
|
||||
typedef std::list<BaseHook*> HookList;
|
||||
|
||||
GWEN_EXPORT HookList& GetHookList();
|
||||
|
||||
GWEN_EXPORT void AddHook( BaseHook* pHook );
|
||||
GWEN_EXPORT void RemoveHook( BaseHook* pHook );
|
||||
|
||||
template< typename fnc >
|
||||
bool CallHook( fnc f )
|
||||
{
|
||||
for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it )
|
||||
{
|
||||
if ( ((*it)->*f)() ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template< typename fnc, typename AA >
|
||||
bool CallHook( fnc f, AA a )
|
||||
{
|
||||
for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it )
|
||||
{
|
||||
if ( ((*it)->*f)( a ) ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template< typename fnc, typename AA, typename AB >
|
||||
bool CallHook( fnc f, AA a, AB b )
|
||||
{
|
||||
for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it )
|
||||
{
|
||||
if ( ((*it)->*f)( a, b ) ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template< typename fnc, typename AA, typename AB, typename AC >
|
||||
bool CallHook( fnc f, AA a, AB b, AC c )
|
||||
{
|
||||
for ( HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it )
|
||||
{
|
||||
if ( ((*it)->*f)( a, b, c ) ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
if (((*it)->*f)()) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename fnc, typename AA>
|
||||
bool CallHook(fnc f, AA a)
|
||||
{
|
||||
for (HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it)
|
||||
{
|
||||
if (((*it)->*f)(a)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename fnc, typename AA, typename AB>
|
||||
bool CallHook(fnc f, AA a, AB b)
|
||||
{
|
||||
for (HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it)
|
||||
{
|
||||
if (((*it)->*f)(a, b)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename fnc, typename AA, typename AB, typename AC>
|
||||
bool CallHook(fnc f, AA a, AB b, AC c)
|
||||
{
|
||||
for (HookList::iterator it = GetHookList().begin(); it != GetHookList().end(); ++it)
|
||||
{
|
||||
if (((*it)->*f)(a, b, c)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} // namespace Hook
|
||||
|
||||
} // namespace Gwen
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user