CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | 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 
00033 #include <limits.h>
00034 
00035 struct iEventQueue;
00036 struct iObjectRegistry;
00037 
00038 // Max event type (in event type enumeration) that will be handled.
00039 #define _CSBASEEVENT_MAXARRAYINDEX csevFrameStart
00040 
00053 class CS_CRYSTALSPACE_EXPORT csBaseEventHandler : public iEventHandler
00054 {
00055 private:
00056   csRef<iEventQueue> queue;
00057 
00058 protected:
00068   csBaseEventHandler ();
00069 
00070 public:
00072   virtual ~csBaseEventHandler ();
00073 
00074 protected:
00075   SCF_DECLARE_IBASE;
00076 
00077 public:
00087   bool RegisterQueue (iObjectRegistry* registry,
00088         unsigned int trigger = UINT_MAX);
00089 
00098   bool RegisterQueue (iEventQueue* queue, unsigned int trigger = UINT_MAX);
00099 
00100 private:
00101   // This contains an array of trigger functions which are used to dispatch
00102   // events based on event type.
00103   static bool (csBaseEventHandler::*pmfnTriggers[
00104         _CSBASEEVENT_MAXARRAYINDEX+1])(iEvent &event);
00105 
00106 protected:
00127   virtual bool HandleEvent (iEvent &event);
00128 
00145   virtual bool OnBroadcast (iEvent &event);
00146 
00148   virtual bool OnCommand (iEvent &event);
00149 
00151   virtual bool OnJoystickMove (iEvent &event);
00152 
00157   virtual bool OnJoystickDown (iEvent &event);
00158 
00160   virtual bool OnJoystickUp (iEvent &event);
00161 
00163   virtual bool OnKeyboard (iEvent &event);
00164 
00166   virtual bool OnMouseMove (iEvent &event);
00167 
00169   virtual bool OnMouseDown (iEvent &event);
00170 
00172   virtual bool OnMouseUp (iEvent &event);
00173 
00175   virtual bool OnMouseClick (iEvent &event);
00176 
00181   virtual bool OnMouseDoubleClick (iEvent &event);
00182 
00189   virtual bool OnUnhandledEvent (iEvent &event);
00190 
00192   virtual void PreProcessFrame ();
00193 
00195   virtual void ProcessFrame ();
00196 
00198   virtual void PostProcessFrame ();
00199 
00201   virtual void FinishFrame ();
00202 };
00203 
00206 #endif //__CS_CSBASEEVENTH_H__

Generated for Crystal Space by doxygen 1.4.4