CrystalSpace

Public API Reference

csutil/evoutlet.h

Go to the documentation of this file.
00001 /*
00002     Crystal Space event outlet class
00003     Written by Andrew Zabolotny <[email protected]>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_UTIL_EVOUTLET_H__
00021 #define __CS_UTIL_EVOUTLET_H__
00022 
00027 #include "csextern.h"
00028 #include "csutil/csunicode.h"
00029 #include "csutil/scf_implementation.h"
00030 #include "csutil/weakref.h"
00031 #include "iutil/event.h"
00032 #include "iutil/csinput.h"
00033 
00034 struct iObjectRegistry;
00035 class csEventQueue;
00036 
00040 class CS_CRYSTALSPACE_EXPORT csEventOutlet : 
00041   public scfImplementation1<csEventOutlet, iEventOutlet>
00042 {
00043 private:
00045   iEventPlug *Plug;
00047   csWeakRef<csEventQueue> Queue;
00049   iObjectRegistry* Registry;
00051   csRef<iKeyboardDriver> KeyboardDriver;
00053   csRef<iMouseDriver> MouseDriver;
00055   csRef<iJoystickDriver> JoystickDriver;
00056 
00057   iKeyboardDriver* GetKeyboardDriver();
00058   iMouseDriver*    GetMouseDriver();
00059   iJoystickDriver* GetJoystickDriver();
00060 
00061 public:
00062 
00064   csEventOutlet (iEventPlug*, csEventQueue*, iObjectRegistry*);
00066   virtual ~csEventOutlet ();
00067 
00069   virtual csPtr<iEvent> CreateEvent ();
00071   virtual void Post (iEvent*);
00073   virtual void Key (utf32_char codeRaw, utf32_char codeCooked, bool iDown,
00074       bool autorep = false);
00076   virtual void Mouse (int iButton, bool iDown, int x, int y);
00078   virtual void Mouse (uint iNumber, int iButton, bool iDown, 
00079                       const int32 *axes, uint numAxes);
00081   virtual void Joystick (uint iNumber, int iButton, bool iDown, 
00082     const int32 *axes, uint numAxes);
00084   virtual void Broadcast (csEventID iName, intptr_t iInfo);
00086   virtual void ImmediateBroadcast (csEventID iName, intptr_t iInfo);
00087 };
00088 
00089 #endif // __CS_UTIL_EVOUTLET_H__

Generated for Crystal Space by doxygen 1.4.7