Google

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/event.h"
00027 #include "iutil/eventh.h"
00028 #include "cssys/system.h"
00029 #include "cssys/djgpp/doshelp.h"
00030 
00031 class SysSystemDriver;
00032 struct iObjectRegistry;
00033 struct iEvent;
00034 
00038 class DosHelper : public iDosHelper
00039 {
00040 private:
00041   SysSystemDriver* sys;
00042 
00043 public:
00044   DosHelper (SysSystemDriver* sys);
00045   virtual ~DosHelper ();
00046 
00047   SCF_DECLARE_IBASE;
00048   virtual void SetMousePosition (int x, int y);
00049   virtual void DoEnablePrintf (bool en);
00050 };
00051 
00053 class SysSystemDriver : public csSystemDriver, public iEventPlug
00054 {
00055 public:
00056   SysSystemDriver (iObjectRegistry* object_reg);
00057   virtual ~SysSystemDriver ();
00058 
00059   bool HandleEvent (iEvent& ev);
00060   virtual bool Initialize ();
00061 
00063   void SetMousePosition (int x, int y);
00065   void DoEnablePrintf (bool en);
00066 
00067   SCF_DECLARE_IBASE_EXT (csSystemDriver);
00068 
00069   //------------------------- iEventPlug interface ---------------------------//
00070 
00071   virtual unsigned GetPotentiallyConflictingEvents ()
00072   { return CSEVTYPE_Keyboard | CSEVTYPE_Mouse; }
00073   virtual unsigned QueryEventPriority (unsigned /*iType*/)
00074   { return 100; }
00075 
00076   struct eiEventHandler : public iEventHandler
00077   {
00078     SCF_DECLARE_EMBEDDED_IBASE (SysSystemDriver);
00079     virtual bool HandleEvent (iEvent& e) { return scfParent->HandleEvent (e); }
00080   } scfiEventHandler;
00081 
00082 private:
00083   bool KeyboardOpened;
00084   bool MouseOpened;
00085   bool MouseExists;
00086   float SensivityFactor;
00087   int mouse_sensivity_x;
00088   int mouse_sensivity_y;
00089   int mouse_sensivity_threshold;
00090   iEventOutlet *EventOutlet;
00091 };
00092 
00093 #endif // DJGPP_H

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