00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
00046 const unsigned LeftButton = 0x0001;
00047 const unsigned RightButton = 0x0002;
00048
00049
00050 enum VideoModeType {TextScrn, LowResGr, HighResGr, Graphics};
00051
00052
00053 class MSMouse {
00054 protected:
00055 int OldX, OldY;
00056 bool OK;
00057 bool MouseOff;
00058 bool TextMode;
00059 bool LowRes;
00060 bool HighRes;
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;
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;
00091
00092 #endif
00093