Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

msmouse.h

Go to the documentation of this file.
00001 /*************************************************************************
00002 *   FILE: msmouse.h
00003 * AUTHOR: Weiskamp, Heiny, Flamig
00004 * DATE: 18 April 1993
00005 * PURPOSE:
00006 *   Header for MSMouse class to interface with Microsoft mouse
00007 *   driver
00008 **************************************************************************
00009 *     REVISION HISTORY
00010 *
00011 *  Rev  Date    Analyst
00012 *
00013 *    0  ??    Weiskamp, Heiny, Flamig
00014 *       Designed.
00015 *    1  16 Apr 1993   Wilson T, Steven W
00016 *       Added 640x480 support, a few additional features.
00017 *    2  18 Apr 1993 CAL
00018 *       Added support for my message-passing protocols.
00019 **************************************************************************/
00020 
00021 #ifndef _MSMOUSE_H
00022 #define _MSMOUSE_H
00023 
00024 #include "typedefs.h"
00025 #include "messages.h"
00026 
00027 const int THRESHOLD = 16;
00028 
00029 // Defines graphics mouse cursor styles
00030 
00031 struct HotSpotStruct {int X, Y;};
00032 
00033 struct MouseCursor {
00034   HotSpotStruct HotSpot;
00035   unsigned ScreenMask[16];
00036   unsigned CursorMask[16];
00037 };
00038 
00039 extern const MouseCursor ArrowCursor;
00040 extern const MouseCursor HandCursor;
00041 extern const MouseCursor LeftRightCursor;
00042 extern const MouseCursor UpDownCursor;
00043 
00044 
00045 // Mouse Button Masks
00046 const unsigned LeftButton   = 0x0001;
00047 const unsigned RightButton    = 0x0002;
00048 
00049 // The video modes that the mouse is running under
00050 enum VideoModeType {TextScrn, LowResGr, HighResGr, Graphics};
00051 
00052 // The mouse object class
00053 class MSMouse {
00054 protected:
00055   int  OldX, OldY;  // Used solely by Moved to keep position
00056   bool OK;    // True if mouse initialized
00057   bool MouseOff;    // True is mouse is disabled (Default)
00058   bool TextMode;    // True if in text mode
00059   bool LowRes;
00060   bool HighRes;   // True is in 640 x 480 graphics mode
00061 
00062   bool DriverExists (void);
00063   int  PressCnt (unsigned ButtonMask);
00064   int  ReleaseCnt (unsigned ButtonMask);
00065   bool Moved (void);
00066   bool Operating (void) { return (bool) (!MouseOff); }
00067   unsigned Status (int &Mx, int &My);
00068   unsigned ButtonStatus (void);
00069   int X, Y, Dx, Dy; // Keeps track of the mouse's movement
00070 public:
00071   MSMouse (void);
00072   MSMouse (VideoModeType VideoMode);
00073   void Setup  (VideoModeType VideoMode);
00074   bool SetupOK (void) { return OK; }
00075   void Hide (void);
00076   void Show (void);
00077   void Move (int Mx, int My);
00078   void TurnOn (void);
00079   void TurnOff (void);
00080   void SetGCursor (const MouseCursor &NewCursor);
00081   void SetMouseCursor (int, int);
00082   void SetSpeed2 ();
00083 
00084   Message Event (void);
00085   Message WaitForAnyEvent (void);
00086   Message WaitForEvent (Message&);
00087   void Flush (void);
00088 };
00089 
00090 extern MSMouse Mouse;   // Global Instance
00091 
00092 #endif
00093 

Generated on Sun Jul 6 23:07:15 2003 for Scotland Yard by doxygen1.2.15