#include <msmouse.h>
Public Methods | |
MSMouse (void) | |
MSMouse (VideoModeType VideoMode) | |
void | Setup (VideoModeType VideoMode) |
bool | SetupOK (void) |
void | Hide (void) |
void | Show (void) |
void | Move (int Mx, int My) |
void | TurnOn (void) |
void | TurnOff (void) |
void | SetGCursor (const MouseCursor &NewCursor) |
void | SetMouseCursor (int, int) |
void | SetSpeed2 () |
Message | Event (void) |
Message | WaitForAnyEvent (void) |
Message | WaitForEvent (Message &) |
void | Flush (void) |
Protected Methods | |
bool | DriverExists (void) |
int | PressCnt (unsigned ButtonMask) |
int | ReleaseCnt (unsigned ButtonMask) |
bool | Moved (void) |
bool | Operating (void) |
unsigned | Status (int &Mx, int &My) |
unsigned | ButtonStatus (void) |
Protected Attributes | |
int | OldX |
int | OldY |
bool | OK |
bool | MouseOff |
bool | TextMode |
bool | LowRes |
bool | HighRes |
int | X |
int | Y |
int | Dx |
int | Dy |
|
Definition at line 28 of file msmouse.c. References False, MouseOff, OK, and True.
|
|
Definition at line 34 of file msmouse.c. References False, MouseOff, OK, Setup(), True, and VideoModeType.
|
|
Definition at line 140 of file msmouse.c. References Operating(), and Status().
|
|
Definition at line 50 of file msmouse.c. Referenced by Setup().
|
|
Definition at line 177 of file msmouse.c. References Idle, LeftButton, LMouseDown, LMouseStillDown, LMouseUp, MouseMsg, Operating(), PressCnt(), ReleaseCnt(), RightButton, RMouseDown, RMouseStillDown, and Status(). Referenced by Flush(), WaitForAnyEvent(), and WaitForEvent().
00178 { 00179 unsigned E; 00180 int Mx, My; 00181 00182 if (!Operating()) 00183 return NullMsg; 00184 00185 // Get current status of buttons 00186 E = Status(Mx,My); 00187 00188 // No mouse button downm, but maybe there was a button press that was 00189 // missed. If not, check to see whether a buttton release was missed. 00190 // Favor the left button 00191 00192 if (E == 0) { 00193 if (PressCnt(LeftButton) > 0) 00194 E = LMouseDown; 00195 else 00196 if (PressCnt (RightButton) > 0) 00197 E = RMouseDown; 00198 // Maybe left one was just released 00199 else 00200 if (ReleaseCnt (LeftButton) > 0) 00201 E = LMouseUp; 00202 // Maybe rightr one was just released 00203 else 00204 if (ReleaseCnt(RightButton) > 0) 00205 E = RMouseDown; 00206 else 00207 E = Idle; 00208 } 00209 00210 else { // a mouse button is down 00211 // was left already down?!?!??! 00212 if (E & LeftButton) { 00213 //not down 00214 if (PressCnt(LeftButton) > 0) 00215 E = LMouseDown; 00216 else 00217 E = LMouseStillDown; 00218 } 00219 else 00220 if (PressCnt(RightButton) > 0) 00221 E = RMouseDown; 00222 else 00223 E = RMouseStillDown; 00224 } 00225 00226 return Message (MouseMsg, E, Mx, My); 00227 } |
|
Definition at line 349 of file msmouse.c. References Message::code, Event(), and Idle.
|
|
Definition at line 90 of file msmouse.c. References MsCall, and Operating(). Referenced by TurnOff().
|
|
Definition at line 270 of file msmouse.c. References MsCall, and Operating(). Referenced by Setup().
00271 { 00272 REGS regs; 00273 00274 if (!Operating()) 00275 return; 00276 00277 regs.x.ax = 4; 00278 regs.x.cx = Mx; 00279 regs.x.dx = My; 00280 00281 if (TextMode) { 00282 regs.x.cx <<= 3; 00283 regs.x.dx <<= 3; 00284 } 00285 00286 if (LowRes) 00287 regs.x.cx <<= 1; 00288 if (HighRes) 00289 regs.x.cx <<= 1; 00290 00291 int86 (MsCall, ®s, ®s); 00292 } |
|
Definition at line 257 of file msmouse.c. References Dx, Dy, False, OldX, OldY, Operating(), Status(), X, and Y.
|
|
Definition at line 66 of file msmouse.h. References MouseOff. Referenced by ButtonStatus(), Event(), Hide(), Move(), Moved(), PressCnt(), ReleaseCnt(), SetGCursor(), Show(), WaitForAnyEvent(), and WaitForEvent().
00066 { return (bool) (!MouseOff); } |
|
Definition at line 150 of file msmouse.c. References MsCall, and Operating(). Referenced by Event().
|
|
Definition at line 163 of file msmouse.c. References MsCall, and Operating(). Referenced by Event().
|
|
Definition at line 310 of file msmouse.c. References MouseCursor::HotSpot, MsCall, Operating(), MouseCursor::ScreenMask, HotSpotStruct::X, and HotSpotStruct::Y.
00311 { 00312 REGS regs; 00313 SREGS sregs; 00314 00315 if (!Operating()) 00316 return; 00317 00318 regs.x.ax = 9; 00319 regs.x.bx = NewCursor.HotSpot.X; 00320 regs.x.cx = NewCursor.HotSpot.Y; 00321 regs.x.dx = FP_OFF(NewCursor.ScreenMask); 00322 sregs.es = FP_SEG(NewCursor.ScreenMask); 00323 00324 int86x(MsCall, ®s, ®s, &sregs); 00325 } |
|
Definition at line 327 of file msmouse.c. References MsCall.
00328 { 00329 REGS regs; 00330 00331 regs.x.ax = 0x4; 00332 regs.x.cx = Mx; 00333 regs.x.dx = My; 00334 00335 int86(MsCall, ®s, ®s); 00336 } |
|
Definition at line 338 of file msmouse.c. References MsCall, and THRESHOLD. Referenced by Setup().
|
|
Definition at line 59 of file msmouse.c. References DriverExists(), Dx, Dy, False, HighRes, HighResGr, LowRes, LowResGr, Move(), MsCall, OK, OldX, OldY, SetSpeed2(), TextMode, TextScrn, True, TurnOff(), TurnOn(), VideoModeType, X, and Y. Referenced by MSMouse().
00060 { 00061 REGS regs; 00062 00063 OK = DriverExists(); 00064 if (OK) { 00065 regs.x.ax = 0; 00066 int86(MsCall, ®s, ®s); 00067 if (regs.x.ax == 0) 00068 OK = False; 00069 } 00070 if (!OK) { // Mouse initialization failed. Set 00071 TurnOff(); // the mouse state off and return. 00072 return; 00073 00074 } 00075 TurnOn(); // Set the mouse state on 00076 00077 if (VideoMode == TextScrn) TextMode = True; else TextMode = False; 00078 if (VideoMode == LowResGr) LowRes = True; else LowRes = False; 00079 if (VideoMode == HighResGr) HighRes = True; else HighRes = False; 00080 00081 OldX = 0; OldY = 0; 00082 X = 0; Y = 0; 00083 Dx = 0; Dy = 0; 00084 Move (0,0); 00085 00086 SetSpeed2(); 00087 } |
|
Definition at line 74 of file msmouse.h. References OK. Referenced by main().
00074 { return OK; } |
|
Definition at line 100 of file msmouse.c. References MsCall, and Operating(). Referenced by TurnOn().
|
|
Definition at line 111 of file msmouse.c. References MsCall. Referenced by ButtonStatus(), Event(), and Moved().
00114 { 00115 REGS regs; 00116 00117 if (!Operating()) { 00118 Mx = My = 0; 00119 return 0; 00120 } 00121 00122 regs.x.ax = 3; 00123 int86(MsCall, ®s, ®s); 00124 00125 Mx = regs.x.cx; 00126 My = regs.x.dx; 00127 00128 if (TextMode) { 00129 Mx >>= 3; // Adjusts for text coordinates 00130 My >>= 3; 00131 } 00132 00133 if (LowRes) 00134 Mx >>= 1; 00135 00136 return regs.x.bx; 00137 } |
|
Definition at line 302 of file msmouse.c. References Hide(), MouseOff, OK, and True. Referenced by Setup().
|
|
Definition at line 294 of file msmouse.c. References False, MouseOff, OK, and Show(). Referenced by Setup().
|
|
Definition at line 229 of file msmouse.c. References Message::code, Event(), Idle, and Operating().
|
|
Definition at line 243 of file msmouse.c. References Message::code, Event(), and Operating().
|
|
|
|
|
|
Definition at line 60 of file msmouse.h. Referenced by Setup(). |
|
Definition at line 59 of file msmouse.h. Referenced by Setup(). |
|
Definition at line 57 of file msmouse.h. Referenced by MSMouse(), Operating(), TurnOff(), and TurnOn(). |
|
Definition at line 56 of file msmouse.h. Referenced by MSMouse(), Setup(), SetupOK(), TurnOff(), and TurnOn(). |
|
|
|
|
|
Definition at line 58 of file msmouse.h. Referenced by Setup(). |
|
|
|
|