Changeset 47174 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 16, 2013 3:27:24 AM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r47124 r47174 14297 14297 </attribute> 14298 14298 14299 <attribute name="multiTouchSupported" type="boolean" readonly="yes"> 14300 <desc> 14301 Whether the guest OS supports multi-touch event reporting. 14302 <note> 14303 You can use the <link to="IMouseCapabilityChangedEvent"/> 14304 event to be instantly informed about changes of this attribute 14305 during virtual machine execution. 14306 </note> 14307 <see><link to="#putMouseEvent"/></see> 14308 </desc> 14309 </attribute> 14310 14299 14311 <attribute name="needsHostCursor" type="boolean" readonly="yes"> 14300 14312 <desc> … … 20214 20226 </interface> 20215 20227 20228 <enum 20229 name="GuestMouseEventMode" 20230 uuid="ef172985-7e36-4297-95be-e46396968d66" 20231 > 20232 20233 <desc> 20234 The mode (relative, absolute, multi-touch) of a pointer event. 20235 TODO: a clear pattern seems to be emerging that we should usually have 20236 multiple input devices active for different types of reporting, so we 20237 should really have different event types for relative (including wheel), 20238 absolute (not including wheel) and multi-touch events. 20239 </desc> 20240 20241 <const name="Relative" value="0"> 20242 <desc> 20243 Relative event. 20244 </desc> 20245 </const> 20246 20247 <const name="Absolute" value="1"> 20248 <desc> 20249 Absolute event. 20250 </desc> 20251 </const> 20252 20253 <const name="MultiTouch" value="2"> 20254 <desc> 20255 Multi-touch event. 20256 </desc> 20257 </const> 20258 </enum> 20259 20216 20260 <interface 20217 20261 name="IGuestMouseEvent" extends="IReusableEvent" … … 20223 20267 </desc> 20224 20268 20225 <attribute name=" absolute" type="boolean" readonly="yes">20226 <desc> 20227 If this event is relative or absolute.20269 <attribute name="mode" type="GuestMouseEventMode" readonly="yes"> 20270 <desc> 20271 If this event is relative, absolute or multi-touch. 20228 20272 </desc> 20229 20273 </attribute> … … 20253 20297 </attribute> 20254 20298 20299 <attribute name="contact" type="long" readonly="yes"> 20300 <desc> 20301 The multi-touch contact identifier. This remains valid as long as a 20302 touch is in progress and can and should be re-used after a touch has 20303 terminated (see @a buttons). 20304 </desc> 20305 </attribute> 20306 20255 20307 <attribute name="buttons" type="long" readonly="yes"> 20256 20308 <desc> 20257 Button state bitmask. 20309 Button state bitmask. Multi-touch events should have the first bit set 20310 as long as the touch is in progress and terminate with an event with no 20311 bits set. 20258 20312 </desc> 20259 20313 </attribute> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r47106 r47174 269 269 uint32_t width, uint32_t height, 270 270 ComSafeArrayIn(uint8_t, aShape)); 271 void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor); 271 void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, 272 BOOL supportsMT, BOOL needsHostCursor); 272 273 void onStateChange(MachineState_T aMachineState); 273 274 void onAdditionsStateChange(); -
trunk/src/VBox/Main/include/MouseImpl.h
r46937 r47174 58 58 STDMETHOD(COMGETTER(AbsoluteSupported)) (BOOL *absoluteSupported); 59 59 STDMETHOD(COMGETTER(RelativeSupported)) (BOOL *relativeSupported); 60 STDMETHOD(COMGETTER(MultiTouchSupported)) (BOOL *multiTouchSupported); 60 61 STDMETHOD(COMGETTER(NeedsHostCursor)) (BOOL *needsHostCursor); 61 62 … … 84 85 85 86 static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID); 86 static DECLCALLBACK(void) mouseReportModes (PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool );87 static DECLCALLBACK(void) mouseReportModes (PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT); 87 88 static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags); 88 89 static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns); … … 93 94 HRESULT reportAbsEventToMouseDev(int32_t mouseXAbs, int32_t mouseYAbs, 94 95 int32_t dz, int32_t dw, uint32_t fButtons); 96 HRESULT reportMTEventToMouseDev(int32_t mouseX, int32_t mouseY, 97 uint32_t cContact, bool fContact); 95 98 HRESULT reportAbsEventToVMMDev(int32_t mouseXAbs, int32_t mouseYAbs); 96 99 HRESULT reportAbsEvent(int32_t mouseXAbs, int32_t mouseYAbs, … … 100 103 bool *pfValid); 101 104 102 void getDeviceCaps(bool *pfAbs, bool *pfRel );105 void getDeviceCaps(bool *pfAbs, bool *pfRel, bool *fMT); 103 106 void sendMouseCapsNotifications(void); 104 107 bool guestNeedsHostCursor(void); … … 107 110 bool supportsAbs(void); 108 111 bool supportsRel(void); 112 bool supportsMT(void); 109 113 110 114 Console * const mParent; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r47117 r47174 6097 6097 */ 6098 6098 #endif 6099 void Console::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, BOOL needsHostCursor) 6099 void Console::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, 6100 BOOL supportsMT, BOOL needsHostCursor) 6100 6101 { 6101 6102 LogFlowThisFunc(("supportsAbsolute=%d supportsRelative=%d needsHostCursor=%d\n", -
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r46937 r47174 37 37 MOUSE_DEVCAP_RELATIVE = 1, 38 38 /** The mouse device can do absolute reporting */ 39 MOUSE_DEVCAP_ABSOLUTE = 2 39 MOUSE_DEVCAP_ABSOLUTE = 2, 40 /** The mouse device can do absolute reporting */ 41 MOUSE_DEVCAP_MULTI_TOUCH = 4 40 42 }; 41 43 /** @} */ … … 171 173 172 174 /** 173 * Returns whether the current setup can accept absolute mouse events, either 174 * because an emulated absolute pointing device is active or because the Guest 175 * Additions are. 175 * Returns whether the currently active device portfolio can accept absolute 176 * mouse events. 176 177 * 177 178 * @returns COM status code … … 191 192 192 193 /** 193 * Returns whether the current setup can accept relative mouse events, that is,194 * whether an emulated relative pointing device is active.194 * Returns whether the currently active device portfolio can accept relative 195 * mouse events. 195 196 * 196 197 * @returns COM status code … … 206 207 207 208 *relativeSupported = supportsRel(); 209 return S_OK; 210 } 211 212 /** 213 * Returns whether the currently active device portfolio can accept multi-touch 214 * mouse events. 215 * 216 * @returns COM status code 217 * @param multiTouchSupported address of result variable 218 */ 219 STDMETHODIMP Mouse::COMGETTER(MultiTouchSupported) (BOOL *multiTouchSupported) 220 { 221 if (!multiTouchSupported) 222 return E_POINTER; 223 224 AutoCaller autoCaller(this); 225 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 226 227 *multiTouchSupported = FALSE; 208 228 return S_OK; 209 229 } … … 344 364 345 365 /** 366 * Send an absolute pointer event to the emulated absolute device we deem most 367 * appropriate. 368 * 369 * @returns COM status code 370 */ 371 HRESULT Mouse::reportMTEventToMouseDev(int32_t mouseX, int32_t mouseY, 372 uint32_t cContact, bool fContact) 373 { 374 return E_NOTIMPL; 375 } 376 377 378 /** 346 379 * Send an absolute position event to the VMM device. 347 380 * @note all calls out of this object are made with no locks held! … … 583 616 /** Check what sort of reporting can be done using the devices currently 584 617 * enabled. Does not consider the VMM device. */ 585 void Mouse::getDeviceCaps(bool *pfAbs, bool *pfRel )618 void Mouse::getDeviceCaps(bool *pfAbs, bool *pfRel, bool *pfMT) 586 619 { 587 620 bool fAbsDev = false; 588 621 bool fRelDev = false; 622 bool fMTDev = false; 589 623 590 624 AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS); … … 597 631 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_RELATIVE) 598 632 fRelDev = true; 633 if (mpDrv[i]->u32DevCaps & MOUSE_DEVCAP_MULTI_TOUCH) 634 fMTDev = true; 599 635 } 600 636 if (pfAbs) … … 610 646 bool fRelDev; 611 647 612 getDeviceCaps(NULL, &fRelDev );648 getDeviceCaps(NULL, &fRelDev, NULL); 613 649 return (mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE) 614 650 && fRelDev; … … 621 657 bool fAbsDev; 622 658 623 getDeviceCaps(&fAbsDev, NULL );659 getDeviceCaps(&fAbsDev, NULL, NULL); 624 660 return fAbsDev; 625 661 } … … 631 667 bool fRelDev; 632 668 633 getDeviceCaps(NULL, &fRelDev );669 getDeviceCaps(NULL, &fRelDev, NULL); 634 670 return fRelDev; 635 671 } … … 641 677 bool fAbsDev; 642 678 643 getDeviceCaps(&fAbsDev, NULL );679 getDeviceCaps(&fAbsDev, NULL, NULL); 644 680 return fAbsDev || vmmdevCanAbs(); 681 } 682 683 684 /** Can we currently send absolute events to the guest? */ 685 bool Mouse::supportsMT(void) 686 { 687 bool fMTDev; 688 689 getDeviceCaps(NULL, NULL, &fMTDev); 690 return fMTDev; 645 691 } 646 692 … … 651 697 void Mouse::sendMouseCapsNotifications(void) 652 698 { 653 bool fAbsDev, fRelDev, f CanAbs, fNeedsHostCursor;699 bool fAbsDev, fRelDev, fMTDev, fCanAbs, fNeedsHostCursor; 654 700 655 701 { 656 702 AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS); 657 703 658 getDeviceCaps(&fAbsDev, &fRelDev );704 getDeviceCaps(&fAbsDev, &fRelDev, &fMTDev); 659 705 fCanAbs = supportsAbs(); 660 706 fNeedsHostCursor = guestNeedsHostCursor(); … … 667 713 * callback data atomically. However I can't see any sign that the cached 668 714 * data is ever used again. */ 669 mParent->onMouseCapabilityChange(fCanAbs, fRelDev, f NeedsHostCursor);715 mParent->onMouseCapabilityChange(fCanAbs, fRelDev, fMTDev, fNeedsHostCursor); 670 716 } 671 717 … … 675 721 * A virtual device is notifying us about its current state and capabilities 676 722 */ 677 DECLCALLBACK(void) Mouse::mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool )723 DECLCALLBACK(void) Mouse::mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT) 678 724 { 679 725 PDRVMAINMOUSE pDrv = RT_FROM_MEMBER(pInterface, DRVMAINMOUSE, IConnector); … … 686 732 else 687 733 pDrv->u32DevCaps &= ~MOUSE_DEVCAP_ABSOLUTE; 734 if (fMT) 735 pDrv->u32DevCaps |= MOUSE_DEVCAP_MULTI_TOUCH; 736 else 737 pDrv->u32DevCaps &= ~MOUSE_DEVCAP_MULTI_TOUCH; 688 738 689 739 pDrv->pMouse->sendMouseCapsNotifications();
Note:
See TracChangeset
for help on using the changeset viewer.