- Timestamp:
- Feb 8, 2023 2:13:14 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r98500 r98503 63 63 #include "CKeyboard.h" 64 64 #include "CMediumAttachment.h" 65 #include "CMouse.h" 65 66 #include "CNATNetwork.h" 66 67 #include "CNetworkAdapter.h" … … 932 933 QApplication::translate("UIMessageCenter", "Failed to assign keyboard parameter.") + 933 934 UIErrorString::formatErrorInfo(comKeyboard)); 935 } 936 937 /* static */ 938 void UINotificationMessage::cannotChangeMouseParameter(const CMouse &comMouse) 939 { 940 createMessage( 941 QApplication::translate("UIMessageCenter", "Mouse failure ..."), 942 QApplication::translate("UIMessageCenter", "Failed to assign mouse parameter.") + 943 UIErrorString::formatErrorInfo(comMouse)); 934 944 } 935 945 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r98500 r98503 73 73 class CEmulatedUSB; 74 74 class CKeyboard; 75 class CMouse; 75 76 class CNetworkAdapter; 76 77 class CVirtualBox; … … 385 386 * @param comKeyboard Brings the object parameter being changed for. */ 386 387 static void cannotChangeKeyboardParameter(const CKeyboard &comKeyboard); 388 /** Notifies about inability to change IMouse parameter. 389 * @param comMouse Brings the object parameter being changed for. */ 390 static void cannotChangeMouseParameter(const CMouse &comMouse); 387 391 /** Notifies about inability to change IVirtualSystemDescription parameter. 388 392 * @param comVsd Brings the object parameter being changed for. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
r98103 r98503 48 48 #include "UIDnDMIMEData.h" 49 49 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */ 50 #include "UIMachine.h" 50 51 #include "UIMessageCenter.h" 51 52 #include "UISession.h" … … 80 81 81 82 82 UIDnDHandler::UIDnDHandler(UISession *pSession, QWidget *pParent) 83 : m_pSession(pSession) 83 UIDnDHandler::UIDnDHandler(UIMachine *pMachine, UISession *pSession, QWidget *pParent) 84 : m_pMachine(pMachine) 85 , m_pSession(pSession) 84 86 , m_pParent(pParent) 85 87 , m_fDataRetrieved(false) … … 754 756 /* Send a mouse event with released mouse buttons into the guest that triggers 755 757 * the "drop" event in our proxy window on the guest. */ 756 AssertPtr(m_pSession); 757 m_pSession->mouse().PutMouseEvent(0, 0, 0, 0, 0); 758 m_pMachine->putMouseEvent(0, 0, 0, 0, 0); 758 759 759 760 msgCenter().showModalProgressDialog(progress, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h
r98103 r98503 46 46 47 47 class UIDnDMIMEData; 48 class UIMachine; 48 49 class UISession; 49 50 … … 57 58 public: 58 59 59 UIDnDHandler(UI Session *pSession, QWidget *pParent);60 UIDnDHandler(UIMachine *pMachine, UISession *pSession, QWidget *pParent); 60 61 virtual ~UIDnDHandler(void); 61 62 … … 133 134 protected: 134 135 135 /** Pointer to UI session. */ 136 /** Pointer to machine UI. */ 137 UIMachine *m_pMachine; 138 /** Pointer to session UI. */ 136 139 UISession *m_pSession; 137 140 /** Pointer to parent widget. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98500 r98503 59 59 #include "CHostVideoInputDevice.h" 60 60 #include "CMachine.h" 61 #include "CMediumAttachment.h" 61 62 #include "CNetworkAdapter.h" 62 63 #include "CProgress.h" … … 466 467 { 467 468 uisession()->putUsageCode(iUsageCode, iUsagePage, fKeyRelease); 469 } 470 471 void UIMachine::putMouseEvent(LONG iDx, LONG iDy, LONG iDz, LONG iDw, LONG iButtonState) 472 { 473 uisession()->putMouseEvent(iDx, iDy, iDz, iDw, iButtonState); 474 } 475 476 void UIMachine::putMouseEventAbsolute(LONG iX, LONG iY, LONG iDz, LONG iDw, LONG iButtonState) 477 { 478 uisession()->putMouseEventAbsolute(iX, iY, iDz, iDw, iButtonState); 479 } 480 481 void UIMachine::putEventMultiTouch(LONG iCount, const QVector<LONG64> &contacts, BOOL fIsTouchScreen, ULONG uScanTime) 482 { 483 uisession()->putEventMultiTouch(iCount, contacts, fIsTouchScreen, uScanTime); 468 484 } 469 485 … … 1748 1764 void UIMachine::updateMouseState() 1749 1765 { 1750 m_fIsMouseSupportsAbsolute = uisession()-> mouse().GetAbsoluteSupported();1751 m_fIsMouseSupportsRelative = uisession()-> mouse().GetRelativeSupported();1752 m_fIsMouseSupportsTouchScreen = uisession()-> mouse().GetTouchScreenSupported();1753 m_fIsMouseSupportsTouchPad = uisession()-> mouse().GetTouchPadSupported();1754 m_fIsMouseHostCursorNeeded = uisession()-> mouse().GetNeedsHostCursor();1766 m_fIsMouseSupportsAbsolute = uisession()->getAbsoluteSupported(); 1767 m_fIsMouseSupportsRelative = uisession()->getRelativeSupported(); 1768 m_fIsMouseSupportsTouchScreen = uisession()->getTouchScreenSupported(); 1769 m_fIsMouseSupportsTouchPad = uisession()->getTouchPadSupported(); 1770 m_fIsMouseHostCursorNeeded = uisession()->getNeedsHostCursor(); 1755 1771 } 1756 1772 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98500 r98503 43 43 /* COM includes: */ 44 44 #include "COMEnums.h" 45 #include "CMediumAttachment.h"46 45 47 46 /* Forward declarations: */ … … 50 49 class UISession; 51 50 class UIMachineLogic; 51 class CMediumAttachment; 52 class CNetworkAdapter; 53 class CUSBDevice; 54 class CVirtualBoxErrorInfo; 52 55 #ifdef VBOX_WS_MAC 53 56 class QMenuBar; … … 370 373 /** Returns mouse-state. */ 371 374 int mouseState() const { return m_iMouseState; } 375 376 /** Sends relative mouse move event to VM's mouse. */ 377 void putMouseEvent(LONG iDx, LONG iDy, LONG iDz, LONG iDw, LONG iButtonState); 378 /** Sends absolute mouse move event to VM's mouse. */ 379 void putMouseEventAbsolute(LONG iX, LONG iY, LONG iDz, LONG iDw, LONG iButtonState); 380 /** Sends multi-touch event to VM's mouse. */ 381 void putEventMultiTouch(LONG iCount, const QVector<LONG64> &contacts, BOOL fIsTouchScreen, ULONG uScanTime); 372 382 /** @} */ 373 383 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98500 r98503 307 307 { 308 308 return uisession()->guest(); 309 }310 311 CMouse& UIMachineLogic::mouse() const312 {313 return uisession()->mouse();314 309 } 315 310 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r98500 r98503 128 128 /** Returns the console's guest reference. */ 129 129 CGuest& guest() const; 130 /** Returns the console's mouse reference. */131 CMouse& mouse() const;132 130 /** Returns the console's debugger reference. */ 133 131 CMachineDebugger& debugger() const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98450 r98503 1328 1328 1329 1329 /* Create the drag and drop handler instance: */ 1330 m_pDnDHandler = new UIDnDHandler(ui session(), this /* pParent */);1330 m_pDnDHandler = new UIDnDHandler(uimachine(), uisession(), this /* pParent */); 1331 1331 if (m_pDnDHandler) 1332 1332 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r98451 r98503 59 59 /* COM includes: */ 60 60 #include "CDisplay.h" 61 #include "CMouse.h"62 61 63 62 /* Other VBox includes: */ … … 202 201 203 202 /* Switch guest mouse to the relative mode: */ 204 mouse().PutMouseEvent(0, 0, 0, 0, 0);203 uimachine()->putMouseEvent(0, 0, 0, 0, 0); 205 204 206 205 /* Notify all the listeners: */ … … 409 408 releaseMouse(); 410 409 /* Also we should switch guest mouse to the absolute mode: */ 411 mouse().PutMouseEventAbsolute(-1, -1, 0, 0, 0);410 uimachine()->putMouseEventAbsolute(-1, -1, 0, 0, 0); 412 411 } 413 412 #if 0 /* current team's decision is NOT to capture mouse on mouse-absolute mode loosing! */ … … 438 437 { 439 438 /* Switch guest mouse to the relative mode: */ 440 mouse().PutMouseEvent(0, 0, 0, 0, 0);439 uimachine()->putMouseEvent(0, 0, 0, 0, 0); 441 440 } 442 441 #endif … … 556 555 { 557 556 return machineLogic()->uisession()->display(); 558 }559 560 CMouse &UIMouseHandler::mouse() const561 {562 return machineLogic()->uisession()->mouse();563 557 } 564 558 … … 984 978 985 979 /* Pass event to the guest: */ 986 mouse().PutMouseEvent(globalPos.x() - m_lastMousePos.x(),987 globalPos.y() - m_lastMousePos.y(),988 iWheelVertical, iWheelHorizontal, iMouseButtonsState);980 uimachine()->putMouseEvent(globalPos.x() - m_lastMousePos.x(), 981 globalPos.y() - m_lastMousePos.y(), 982 iWheelVertical, iWheelHorizontal, iMouseButtonsState); 989 983 990 984 #ifdef VBOX_WS_WIN … … 1152 1146 1153 1147 /* Post absolute mouse-event into guest: */ 1154 mouse().PutMouseEventAbsolute(cpnt.x() + 1, cpnt.y() + 1, iWheelVertical, iWheelHorizontal, iMouseButtonsState);1148 uimachine()->putMouseEventAbsolute(cpnt.x() + 1, cpnt.y() + 1, iWheelVertical, iWheelHorizontal, iMouseButtonsState); 1155 1149 return true; 1156 1150 } … … 1274 1268 } 1275 1269 1276 mouse().PutEventMultiTouch(pTouchEvent->touchPoints().size(),1277 contacts,1278 fTouchScreen,1279 (ULONG)RTTimeMilliTS());1270 uimachine()->putEventMultiTouch(pTouchEvent->touchPoints().size(), 1271 contacts, 1272 fTouchScreen, 1273 (ULONG)RTTimeMilliTS()); 1280 1274 1281 1275 /* Eat by default? */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
r98451 r98503 50 50 class UIMachineWindow; 51 51 class CDisplay; 52 class CMouse;53 52 54 53 … … 112 111 /** Returns the console's display reference. */ 113 112 CDisplay &display() const; 114 /** Returns the console's mouse reference. */115 CMouse &mouse() const;116 113 117 114 /* Event handler for registered machine-view(s): */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98500 r98503 304 304 if (!comKeyboard.isOk()) 305 305 UINotificationMessage::cannotChangeKeyboardParameter(comKeyboard); 306 } 307 308 BOOL UISession::getAbsoluteSupported() 309 { 310 return mouse().GetAbsoluteSupported(); 311 } 312 313 BOOL UISession::getRelativeSupported() 314 { 315 return mouse().GetRelativeSupported(); 316 } 317 318 BOOL UISession::getTouchScreenSupported() 319 { 320 return mouse().GetTouchScreenSupported(); 321 } 322 323 BOOL UISession::getTouchPadSupported() 324 { 325 return mouse().GetTouchPadSupported(); 326 } 327 328 BOOL UISession::getNeedsHostCursor() 329 { 330 return mouse().GetNeedsHostCursor(); 331 } 332 333 void UISession::putMouseEvent(LONG iDx, LONG iDy, LONG iDz, LONG iDw, LONG iButtonState) 334 { 335 CMouse comMouse = mouse(); 336 comMouse.PutMouseEvent(iDx, iDy, iDz, iDw, iButtonState); 337 if (!comMouse.isOk()) 338 UINotificationMessage::cannotChangeMouseParameter(comMouse); 339 } 340 341 void UISession::putMouseEventAbsolute(LONG iX, LONG iY, LONG iDz, LONG iDw, LONG iButtonState) 342 { 343 CMouse comMouse = mouse(); 344 comMouse.PutMouseEventAbsolute(iX, iY, iDz, iDw, iButtonState); 345 if (!comMouse.isOk()) 346 UINotificationMessage::cannotChangeMouseParameter(comMouse); 347 } 348 349 void UISession::putEventMultiTouch(LONG iCount, const QVector<LONG64> &contacts, BOOL fIsTouchScreen, ULONG uScanTime) 350 { 351 CMouse comMouse = mouse(); 352 comMouse.PutEventMultiTouch(iCount, contacts, fIsTouchScreen, uScanTime); 353 if (!comMouse.isOk()) 354 UINotificationMessage::cannotChangeMouseParameter(comMouse); 306 355 } 307 356 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98500 r98503 247 247 /** @} */ 248 248 249 /** @name Mouse stuff. 250 ** @{ */ 251 /** Returns whether VM's mouse supports absolute coordinates. */ 252 BOOL getAbsoluteSupported(); 253 /** Returns whether VM's mouse supports relative coordinates. */ 254 BOOL getRelativeSupported(); 255 /** Returns whether VM's mouse supports touch screen device. */ 256 BOOL getTouchScreenSupported(); 257 /** Returns whether VM's mouse supports touch pad device. */ 258 BOOL getTouchPadSupported(); 259 /** Returns whether VM's mouse requires host cursor. */ 260 BOOL getNeedsHostCursor(); 261 262 /** Sends relative mouse move event to VM's mouse. */ 263 void putMouseEvent(LONG iDx, LONG iDy, LONG iDz, LONG iDw, LONG iButtonState); 264 /** Sends absolute mouse move event to VM's mouse. */ 265 void putMouseEventAbsolute(LONG iX, LONG iY, LONG iDz, LONG iDw, LONG iButtonState); 266 /** Sends multi-touch event to VM's mouse. */ 267 void putEventMultiTouch(LONG iCount, const QVector<LONG64> &contacts, BOOL fIsTouchScreen, ULONG uScanTime); 268 /** @} */ 269 249 270 /** @name Guest additions stuff. 250 271 ** @{ */
Note:
See TracChangeset
for help on using the changeset viewer.