Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

evoutlet.h

00001 /*
00002     Crystal Space event outlet class
00003     Written by Andrew Zabolotny <bit@eltech.ru>
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 __CSUTIL_EVOUTLET_H__
00021 #define __CSUTIL_EVOUTLET_H__
00022 
00023 #include "iutil/event.h"
00024 struct iJoystickDriver;
00025 struct iKeyboardDriver;
00026 struct iMouseDriver;
00027 struct iObjectRegistry;
00028 class csEventQueue;
00029 
00033 class csEventOutlet : public iEventOutlet
00034 {
00035 private:
00036   // The mask of events to allow from this plug
00037   unsigned EnableMask;
00038   // The event plug object
00039   iEventPlug *Plug;
00040   // The owning event queue
00041   csEventQueue *Queue;
00042   // The shared-object registry.
00043   iObjectRegistry* Registry;
00044   // The shared keyboard driver.
00045   iKeyboardDriver* KeyboardDriver;
00046   // The shared mouse driver.
00047   iMouseDriver* MouseDriver;
00048   // The shared joystick driver.
00049   iJoystickDriver* JoystickDriver;
00050 
00051   iKeyboardDriver* GetKeyboardDriver();
00052   iMouseDriver*    GetMouseDriver();
00053   iJoystickDriver* GetJoystickDriver();
00054 
00055 public:
00056   SCF_DECLARE_IBASE;
00057 
00058   // Initialize the outlet
00059   csEventOutlet (iEventPlug*, csEventQueue*, iObjectRegistry*);
00060   // Destroy the outlet
00061   virtual ~csEventOutlet ();
00062 
00063   // Create a event object on behalf of the system driver.
00064   virtual iEvent *CreateEvent ();
00065   // Put a previously created event into system event queue.
00066   virtual void Post (iEvent*);
00067   // Put a keyboard event into event queue.
00068   virtual void Key (int iKey, int iChar, bool iDown);
00069   // Put a mouse event into event queue.
00070   virtual void Mouse (int iButton, bool iDown, int x, int y);
00071   // Put a joystick event into event queue.
00072   virtual void Joystick (int iNumber, int iButton, bool iDown, int x, int y);
00073   // Put a broadcast event into event queue.
00074   virtual void Broadcast (int iCode, void *iInfo);
00075   // Broadcast a event to all plugins
00076   virtual void ImmediateBroadcast (int iCode, void *iInfo);
00077 };
00078 
00079 #endif // __CSUTIL_EVOUTLET_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000