EventManager::EventManager()  
	{
		for (int i = 0; i <= Event_Listings::MAX; ++i)
		{
			Registrants[i] = Listeners();
		}
	}
void DialogHierarchy::produceTerminated(const DialogHierarchyEventPtr e)
{
    DialogHierarchyListenerSet Listeners(_DialogHierarchyListeners);
    for(DialogHierarchyListenerSetConstItor SetItor(Listeners.begin()) ; SetItor != Listeners.end() ; ++SetItor)
    {
	    (*SetItor)->terminated(e);
    }
    _Producer.produceEvent(TerminatedMethodId,e);
}
void DialogHierarchy::produceDialogResponsesReady(const DialogHierarchyEventPtr e)
{
    DialogHierarchyListenerSet Listeners(_DialogHierarchyListeners);
    for(DialogHierarchyListenerSetConstItor SetItor(Listeners.begin()) ; SetItor != Listeners.end() ; ++SetItor)
    {
	    (*SetItor)->dialogResponsesReady(e);
    }
    _Producer.produceEvent(DialogResponsesReadyMethodId,e);
}
예제 #4
0
void Inventory::produceItemRemoved(const InventoryEventPtr e)
{
	InventoryListenerSet Listeners(_InventoryListeners);
    for(InventoryListenerSetConstItor SetItor(Listeners.begin()) ; SetItor != Listeners.end() ; ++SetItor)
    {
	    (*SetItor)->itemRemoved(e);
    }
    _Producer.produceEvent(ItemRemovedMethodId,e);
}
void DragGestureRecognizer::produceDragGestureRecognized(ComponentRefPtr TheComponent, const Pnt2f &DragLocation) const
{
    const DragGestureEventUnrecPtr e = DragGestureEvent::create(TheComponent, getSystemTime(), DragLocation);
	DragGestureListenerSet Listeners(_DragGestureListeners);
    for(DragGestureListenerSetConstItor SetItor(Listeners.begin()) ; SetItor != Listeners.end() ; ++SetItor)
    {
	    (*SetItor)->draqGestureRecognized(e);
    }
}
예제 #6
0
void VideoWrapper::produceCycled(void)
{
    VideoEventUnrecPtr TheEvent = VideoEvent::create(VideoWrapperRefPtr(this), getSystemTime());
	VideoListenerSet Listeners(_VideoListeners);
    for(VideoListenerSetConstItor SetItor(Listeners.begin()) ; SetItor != Listeners.end() ; ++SetItor)
    {
	    (*SetItor)->cycled(TheEvent);
    }
    _Producer.produceEvent(VideoCycledMethodId,TheEvent);
}
void EventDispatcher::AttachEvent(const String& type, EventListener* listener, bool in_capture_phase)
{
	// Look up the event
	Events::iterator event_itr = events.find(type);

	// Ensure the event is in the event list
	if (event_itr == events.end())
	{
		event_itr = events.insert(std::pair< String, Listeners >(type, Listeners())).first;
	}

	// Add the action to the events
	(*event_itr).second.push_back(Listener(listener, in_capture_phase));

	listener->OnAttach(element);
}
예제 #8
0
파일: Debug.cpp 프로젝트: ace13/bootil
		void IListener::Remove( IListener* listener )
		{
			Listeners().remove( listener );
		}
예제 #9
0
파일: Debug.cpp 프로젝트: ace13/bootil
		void IListener::Add( IListener* listener )
		{
			Listeners().push_back( listener );
		}