CrystalSpace

Public API Reference

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

csutil/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 
00028 #include <iutil/event.h>
00029 #include <iutil/eventh.h>
00030 #include <iutil/eventq.h>
00031 #include <iutil/objreg.h>
00032 
00033 #include <limits.h>
00034 
00035 // Max event type (in event type enumeration) that will be handled.
00036 #define _CSBASEEVENT_MAXARRAYINDEX csevNetwork
00037 
00050 class csBaseEventHandler : public iEventHandler
00051 {
00052 private:
00053   csRef<iEventQueue> queue;
00054 
00055 protected:
00065   csBaseEventHandler ();
00066 
00067 public:
00069   virtual ~csBaseEventHandler ();
00070 
00071 protected:
00072   SCF_DECLARE_IBASE;
00073 
00074 public:
00084   bool RegisterQueue (iObjectRegistry* registry,
00085         unsigned int trigger = UINT_MAX);
00086 
00095   bool RegisterQueue (iEventQueue* queue, unsigned int trigger = UINT_MAX);
00096 
00097 private:
00098   // This contains an array of trigger functions which are used to dispatch
00099   // events based on event type.
00100   static bool (csBaseEventHandler::*pmfnTriggers[
00101         _CSBASEEVENT_MAXARRAYINDEX+1])(iEvent &event);
00102 
00103 private:
00110   virtual bool HandleEvent (iEvent &event);
00111 
00112 protected:
00129   virtual bool OnBroadcast (iEvent &event);
00130 
00132   virtual bool OnCommand (iEvent &event);
00133 
00135   virtual bool OnJoystickMove (iEvent &event);
00136 
00140   virtual bool OnJoystickDown (iEvent &event);
00141 
00143   virtual bool OnJoystickUp (iEvent &event);
00144 
00146   virtual bool OnKeyboard (iEvent &event);
00147 
00149   virtual bool OnMouseMove (iEvent &event);
00150 
00152   virtual bool OnMouseDown (iEvent &event);
00153 
00155   virtual bool OnMouseUp (iEvent &event);
00156 
00158   virtual bool OnMouseClick (iEvent &event);
00159 
00164   virtual bool OnMouseDoubleClick (iEvent &event);
00165 
00167   virtual bool OnNetwork (iEvent &event);
00168 
00175   virtual bool OnUnhandledEvent (iEvent &event);
00176 
00178   virtual void PreProcessFrame ();
00179 
00181   virtual void ProcessFrame ();
00182 
00184   virtual void PostProcessFrame ();
00185 
00187   virtual void FinishFrame ();
00188 };
00189 
00192 #endif //__CS_CSBASEEVENTH_H__

Generated for Crystal Space by doxygen 1.2.18