Blender V2.61 - r43446

GHOST_EventManager.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #ifndef _GHOST_EVENT_MANAGER_H_
00034 #define _GHOST_EVENT_MANAGER_H_
00035 
00036 #include <deque>
00037 #include <vector>
00038 
00039 #include "GHOST_IEventConsumer.h"
00040 
00041 
00050 class GHOST_EventManager
00051 {
00052 public:
00056     GHOST_EventManager();
00057 
00061     virtual ~GHOST_EventManager();
00062 
00067     virtual GHOST_TUns32    getNumEvents();
00068 
00074     virtual GHOST_TUns32    getNumEvents(GHOST_TEventType type);
00075 
00081     virtual GHOST_IEvent* peekEvent();
00082 
00089     virtual GHOST_TSuccess pushEvent(GHOST_IEvent* event);
00090 
00095     virtual bool dispatchEvent(GHOST_IEvent* event);
00096 
00102     virtual bool dispatchEvent();
00103 
00109     virtual bool dispatchEvents();
00110 
00116     virtual GHOST_TSuccess addConsumer(GHOST_IEventConsumer* consumer);
00117 
00123     virtual GHOST_TSuccess removeConsumer(GHOST_IEventConsumer* consumer);
00124 
00129         virtual void
00130     removeWindowEvents(
00131         GHOST_IWindow* window
00132      );
00133 
00141         virtual void
00142     removeTypeEvents(
00143         GHOST_TEventType type,
00144         GHOST_IWindow* window = 0
00145     );
00146 
00147 protected:
00153     virtual GHOST_IEvent* popEvent();
00154 
00158     virtual void disposeEvents();
00159 
00161     typedef std::deque<GHOST_IEvent*> TEventStack;
00162     
00164     std::deque<GHOST_IEvent*> m_events;
00165 
00167     typedef std::vector<GHOST_IEventConsumer*> TConsumerVector;
00168 
00170     TConsumerVector m_consumers;
00171 };
00172 
00173 #endif // _GHOST_EVENT_MANAGER_H_
00174