commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
48
include/engine/ui/ui_event_handler.cpp
Normal file
48
include/engine/ui/ui_event_handler.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "ui/ui_event_handler.h"
|
||||
|
||||
using namespace GS::S2D;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
EventHandler *EventTable::GetHandler(EventCode code) const
|
||||
{
|
||||
ListForeachPtr(EventHandler *, h, handler_list)
|
||||
if (h->GetCode() == code)
|
||||
return h;
|
||||
return NULL;
|
||||
}
|
||||
EventHandler *EventTable::SetHandler(EventCode code, GS::Script::Object *h, GS::Script::Object *c)
|
||||
{
|
||||
EventHandler *handler = GetHandler(code);
|
||||
|
||||
if (!handler)
|
||||
{
|
||||
handler = new EventHandler(code);
|
||||
handler_list.Add(handler);
|
||||
}
|
||||
|
||||
handler->handler = h;
|
||||
handler->context = c;
|
||||
return handler;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void EventTable::DeleteHandler(EventCode code)
|
||||
{
|
||||
handler_list.Remove(GetHandler(code));
|
||||
}
|
||||
bool EventTable::HasHandlerContext(EventCode code) const
|
||||
{
|
||||
EventHandler *handler = GetHandler(code);
|
||||
if (!handler)
|
||||
return false;
|
||||
return asbool(handler);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user