Changeset 32828 in vbox
- Timestamp:
- Sep 29, 2010 7:21:53 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MouseImpl.cpp
r32817 r32828 149 149 ///////////////////////////////////////////////////////////////////////////// 150 150 151 /** Query the VMM device for the Guest Additions's (and the host front-end's) 152 * mouse handling capabilities. 153 * @note all calls out of this object are made with no locks held! */ 151 154 HRESULT Mouse::getVMMDevMouseCaps(uint32_t *pfCaps) 152 155 { … … 163 166 } 164 167 168 /** Report the front-end's mouse handling capabilities to the VMM device and 169 * thus to the guest. 170 * @note all calls out of this object are made with no locks held! */ 165 171 HRESULT Mouse::setVMMDevMouseCaps(uint32_t fCaps) 166 172 { … … 175 181 176 182 /** 177 * Returns whether the current setup can accept absolute mouse 178 * events. 183 * Returns whether the current setup can accept absolute mouse events, either 184 * because an emulated absolute pointing device is active or because the Guest 185 * Additions are. 179 186 * 180 187 * @returns COM status code … … 204 211 205 212 /** 206 * Returns whether the current setup can accept relative mouse 207 * events.213 * Returns whether the current setup can accept relative mouse events, that is, 214 * whether an emulated relative pointing device is active. 208 215 * 209 216 * @returns COM status code … … 230 237 231 238 /** 232 * Returns whether the guest can currently draw the mouse cursor itself. 239 * Returns whether the guest can currently switch to drawing the mouse cursor 240 * itself if it is asked to by the front-end. 233 241 * 234 242 * @returns COM status code … … 250 258 ///////////////////////////////////////////////////////////////////////////// 251 259 260 /** Converts a bitfield containing information about mouse buttons currently 261 * held down from the format used by the front-end to the format used by PDM 262 * and the emulated pointing devices. */ 252 263 static uint32_t mouseButtonsToPDM(LONG buttonState) 253 264 { … … 268 279 269 280 /** 270 * Send a relative event to the mouse device. 281 * Send a relative pointer event to the relative device we deem most 282 * appropriate. 271 283 * 272 284 * @returns COM status code … … 303 315 304 316 /** 305 * Send an absolute position event to the mouse device. 317 * Send an absolute pointer event to the emulated absolute device we deem most 318 * appropriate. 306 319 * 307 320 * @returns COM status code … … 340 353 /** 341 354 * Send an absolute position event to the VMM device. 355 * @note all calls out of this object are made with no locks held! 342 356 * 343 357 * @returns COM status code … … 362 376 } 363 377 378 379 /** 380 * Send an absolute pointer event to a pointing device (the VMM device if 381 * possible or whatever emulated absolute device seems best to us if not). 382 * 383 * @returns COM status code 384 */ 364 385 HRESULT Mouse::reportAbsEvent(uint32_t mouseXAbs, uint32_t mouseYAbs, 365 386 int32_t dz, int32_t dw, uint32_t fButtons, … … 393 414 394 415 /** 395 * Send a mouse event. 416 * Send a relative mouse event to the guest. 417 * @note the VMMDev capability change is so that the guest knows we are sending 418 * real events over the PS/2 device and not dummy events to signal the 419 * arrival of new absolute pointer data 396 420 * 397 421 * @returns COM status code … … 426 450 fButtons = mouseButtonsToPDM(buttonState); 427 451 } 452 /** @note we drop the lock before calling out of the object! */ 428 453 if (fUpdateCaps) 429 454 setVMMDevMouseCaps(uHostCaps); … … 463 488 * specific drivers installed in the guest or absolute pointing device 464 489 * emulation. 490 * @note the VMMDev capability change is so that the guest knows we are sending 491 * dummy events over the PS/2 device to signal the arrival of new 492 * absolute pointer data, and not pointer real movement data 493 * @note all calls out of this object are made with no locks held! 465 494 * 466 495 * @returns COM status code … … 514 543 } 515 544 } 545 /** @note we drop the lock again before calling out! */ 516 546 if (fUpdateCaps) 517 547 setVMMDevMouseCaps(uHostCaps); … … 528 558 529 559 560 /** Work out what mouse capabilities the guest and the front-end have to offer, 561 * based on the state of the available emulated devices and the capabilities 562 * the guest has signalled to the VMM device, and notify the guest and the 563 * Console respectively about what the other can do. */ 530 564 void Mouse::sendMouseCapsNotifications(void) 531 565 { … … 550 584 uHostCaps &= ~VMMDEV_MOUSE_HOST_HAS_ABS_DEV; 551 585 } 586 /** @note we drop the lock again before calling out! */ 552 587 if (SUCCEEDED(getVMMDevMouseCaps(&u32MouseCaps))) 553 588 fVMMDevCanAbs = (u32MouseCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE) … … 568 603 /** 569 604 * @interface_method_impl{PDMIMOUSECONNECTOR,pfnReportModes} 605 * A virtual device is notifying us about its current state and capabilities 570 606 */ 571 607 DECLCALLBACK(void) Mouse::mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs) -
trunk/src/VBox/Main/include/MouseImpl.h
r32817 r32828 94 94 } 95 95 96 / / for VMMDevInterface96 /** notify the front-end that the guest now supports absolute reporting */ 97 97 void onVMMDevCanAbsChange(bool) 98 98 { … … 100 100 } 101 101 102 /** notify the front-end as to whether the guest can start drawing its own 103 * cursor on demand */ 102 104 void onVMMDevNeedsHostChange(bool needsHost) 103 105 {
Note:
See TracChangeset
for help on using the changeset viewer.