Main Page   Class Hierarchy   Compound List   File List   Compound Members  

djgpp.h

00001 /*
00002     DOS support for Crystal Space 3D library
00003     Copyright (C) 1998 by Jorrit Tyberghein
00004     Written by David N. Arnold <derek_arnold@fuse.net>
00005     Written by Andrew Zabolotny <bit@eltech.ru>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public
00018     License along with this library; if not, write to the Free
00019     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 */
00021 
00022 #ifndef DJGPP_H
00023 #define DJGPP_H
00024 
00025 #include "csutil/csinput.h"
00026 #include "iutil/eventh.h"
00027 #include "cssys/system.h"
00028 #include "cssys/djgpp/doshelp.h"
00029 
00030 class SysSystemDriver;
00031 struct iObjectRegistry;
00032 struct iEvent;
00033 
00037 class DosHelper : public DosHelper
00038 {
00039 private:
00040   SysSystemDriver* sys;
00041 
00042 public:
00043   DosHelper (SysSystemDriver* sys);
00044   virtual ~DosHelper ();
00045 
00046   SCF_DECLARE_IBASE;
00047   virtual void SetMousePosition (int x, int y);
00048   virtual void EnablePrintf (bool en);
00049 };
00050 
00052 class SysSystemDriver : public csSystemDriver, public iEventPlug
00053 {
00054 public:
00055   SysSystemDriver (iObjectRegistry* object_reg);
00056   virtual ~SysSystemDriver ();
00057 
00058   bool HandleEvent (iEvent& ev);
00059   virtual bool Initialize ();
00060 
00062   void SetMousePosition (int x, int y);
00064   void DoEnablePrintf (bool en);
00065 
00066   SCF_DECLARE_IBASE_EXT (csSystemDriver);
00067 
00068   //------------------------- iEventPlug interface ---------------------------//
00069 
00070   virtual unsigned GetPotentiallyConflictingEvents ()
00071   { return CSEVTYPE_Keyboard | CSEVTYPE_Mouse; }
00072   virtual unsigned QueryEventPriority (unsigned /*iType*/)
00073   { return 100; }
00074 
00075   struct eiEventHandler : public iEventHandler
00076   {
00077     SCF_DECLARE_EMBEDDED_IBASE (SysSystemDriver);
00078     virtual bool HandleEvent (iEvent& e) { return scfParent->HandleEvent (e); }
00079   } scfiEventHandler;
00080 
00081 private:
00082   bool KeyboardOpened;
00083   bool MouseOpened;
00084   bool MouseExists;
00085   float SensivityFactor;
00086   int mouse_sensivity_x;
00087   int mouse_sensivity_y;
00088   int mouse_sensivity_threshold;
00089   iEventOutlet *EventOutlet;
00090 };
00091 
00092 #endif // DJGPP_H

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