3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
29 /** \file ghost/GHOST_IEventConsumer.h
31 * Declaration of GHOST_IEventConsumer interface class.
34 #ifndef _GHOST_IEVENT_CONSUMER_H_
35 #define _GHOST_IEVENT_CONSUMER_H_
37 #include "GHOST_IEvent.h"
40 * Interface class for objects interested in receiving events.
41 * Objects interested in events should inherit this class and implement the
42 * processEvent() method. They should then be registered with the system that
43 * they want to receive events. The system will call the processEvent() method
44 * for every installed event consumer to pass events.
45 * @see GHOST_ISystem#addEventConsumer
46 * @author Maarten Gribnau
49 class GHOST_IEventConsumer
55 virtual ~GHOST_IEventConsumer()
60 * This method is called by the system when it has events to dispatch.
61 * @see GHOST_ISystem#dispatchEvents
62 * @param event The event that can be handled or ignored.
63 * @return Indication as to whether the event was handled.
65 virtual bool processEvent(GHOST_IEvent* event) = 0;
67 #ifdef WITH_CXX_GUARDEDALLOC
69 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_IEventConsumer"); }
70 void operator delete( void *mem ) { MEM_freeN(mem); }
74 #endif // _GHOST_EVENT_CONSUMER_H_