CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csbaseeventh.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2003 by Odes B. Boatwright.
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library 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 GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_CSBASEEVENTH_H__
00020 #define __CS_CSBASEEVENTH_H__
00021 
00022 #include "csextern.h"
00023 
00030 #include <iutil/event.h>
00031 #include <iutil/eventh.h>
00032 #include <iutil/eventq.h>
00033 #include <iutil/objreg.h>
00034 
00035 #include <limits.h>
00036 
00037 // Max event type (in event type enumeration) that will be handled.
00038 #define _CSBASEEVENT_MAXARRAYINDEX csevFrameStart
00039 
00052 class CS_CSUTIL_EXPORT csBaseEventHandler : public iEventHandler
00053 {
00054 private:
00055   csRef<iEventQueue> queue;
00056 
00057 protected:
00067   csBaseEventHandler ();
00068 
00069 public:
00071   virtual ~csBaseEventHandler ();
00072 
00073 protected:
00074   SCF_DECLARE_IBASE;
00075 
00076 public:
00086   bool RegisterQueue (iObjectRegistry* registry,
00087         unsigned int trigger = UINT_MAX);
00088 
00097   bool RegisterQueue (iEventQueue* queue, unsigned int trigger = UINT_MAX);
00098 
00099 private:
00100   // This contains an array of trigger functions which are used to dispatch
00101   // events based on event type.
00102   static bool (csBaseEventHandler::*pmfnTriggers[
00103         _CSBASEEVENT_MAXARRAYINDEX+1])(iEvent &event);
00104 
00105 protected:
00126   virtual bool HandleEvent (iEvent &event);
00127 
00144   virtual bool OnBroadcast (iEvent &event);
00145 
00147   virtual bool OnCommand (iEvent &event);
00148 
00150   virtual bool OnJoystickMove (iEvent &event);
00151 
00156   virtual bool OnJoystickDown (iEvent &event);
00157 
00159   virtual bool OnJoystickUp (iEvent &event);
00160 
00162   virtual bool OnKeyboard (iEvent &event);
00163 
00165   virtual bool OnMouseMove (iEvent &event);
00166 
00168   virtual bool OnMouseDown (iEvent &event);
00169 
00171   virtual bool OnMouseUp (iEvent &event);
00172 
00174   virtual bool OnMouseClick (iEvent &event);
00175 
00180   virtual bool OnMouseDoubleClick (iEvent &event);
00181 
00188   virtual bool OnUnhandledEvent (iEvent &event);
00189 
00191   virtual void PreProcessFrame ();
00192 
00194   virtual void ProcessFrame ();
00195 
00197   virtual void PostProcessFrame ();
00198 
00200   virtual void FinishFrame ();
00201 };
00202 
00205 #endif //__CS_CSBASEEVENTH_H__

Generated for Crystal Space by doxygen 1.3.9.1