Changeset 47190 in vbox for trunk/src/VBox
- Timestamp:
- Jul 16, 2013 1:44:46 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r47174 r47190 49 49 class ExtPackManager; 50 50 #endif 51 class VMMDevMouseInterface; 52 class DisplayMouseInterface; 51 53 52 54 #include <VBox/RemoteDesktop/VRDE.h> … … 89 91 /////////////////////////////////////////////////////////////////////////////// 90 92 93 class ConsoleMouseInterface 94 { 95 public: 96 virtual VMMDevMouseInterface *getVMMDevMouseInterface() = 0; 97 virtual DisplayMouseInterface *getDisplayMouseInterface() = 0; 98 virtual void onMouseCapabilityChange(BOOL supportsAbsolute, 99 BOOL supportsRelative, 100 BOOL supportsMT, 101 BOOL needsHostCursor) = 0; 102 }; 103 91 104 /** IConsole implementation class */ 92 105 class ATL_NO_VTABLE Console : 93 106 public VirtualBoxBase, 94 VBOX_SCRIPTABLE_IMPL(IConsole) 107 VBOX_SCRIPTABLE_IMPL(IConsole), public ConsoleMouseInterface 95 108 { 96 109 Q_OBJECT … … 291 304 HRESULT onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove, 292 305 NATProtocol_T aProto, IN_BSTR aHostIp, LONG aHostPort, IN_BSTR aGuestIp, LONG aGuestPort); 306 307 // Mouse interface 308 VMMDevMouseInterface *getVMMDevMouseInterface(); 309 DisplayMouseInterface *getDisplayMouseInterface(); 293 310 294 311 private: -
trunk/src/VBox/Main/include/DisplayImpl.h
r46523 r47190 104 104 } DISPLAYFBINFO; 105 105 106 class DisplayMouseInterface 107 { 108 public: 109 virtual int getScreenResolution(uint32_t cScreen, uint32_t *pcx, 110 uint32_t *pcy, uint32_t *pcBPP) = 0; 111 virtual void getFramebufferDimensions(int32_t *px1, int32_t *py1, 112 int32_t *px2, int32_t *py2) = 0; 113 }; 114 106 115 class ATL_NO_VTABLE Display : 107 116 public VirtualBoxBase, 108 117 VBOX_SCRIPTABLE_IMPL(IEventListener), 109 VBOX_SCRIPTABLE_IMPL(IDisplay) 118 VBOX_SCRIPTABLE_IMPL(IDisplay), 119 public DisplayMouseInterface 110 120 { 111 121 public: … … 151 161 } 152 162 void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2, int32_t *py2); 163 int getScreenResolution(uint32_t cScreen, uint32_t *pcx, uint32_t *pcy, 164 uint32_t *pcBPP) 165 { 166 return GetScreenResolution(cScreen, pcx, pcy, pcBPP); 167 } 153 168 154 169 int handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect); -
trunk/src/VBox/Main/include/MouseImpl.h
r47174 r47190 52 52 53 53 // public initializer/uninitializer for internal purposes only 54 HRESULT init(Console *parent);54 HRESULT init(ConsoleMouseInterface *parent); 55 55 void uninit(); 56 56 … … 70 70 static const PDMDRVREG DrvReg; 71 71 72 Console *getParent() const72 ConsoleMouseInterface *getParent() const 73 73 { 74 74 return mParent; … … 112 112 bool supportsMT(void); 113 113 114 Console * const mParent;114 ConsoleMouseInterface * const mParent; 115 115 /** Pointer to the associated mouse driver. */ 116 116 struct DRVMAINMOUSE *mpDrv[MOUSE_MAX_DEVICES]; -
trunk/src/VBox/Main/include/VMMDev.h
r44528 r47190 24 24 class Console; 25 25 26 class VMMDev 26 class VMMDevMouseInterface 27 { 28 public: 29 virtual PPDMIVMMDEVPORT getVMMDevPort() = 0; 30 }; 31 32 class VMMDev : public VMMDevMouseInterface 27 33 { 28 34 public: … … 49 55 PPDMIVMMDEVPORT getVMMDevPort(); 50 56 57 #ifdef VBOX_WITH_HGCM 51 58 int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName); 52 59 int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms); … … 59 66 60 67 bool hgcmIsActive (void) { return ASMAtomicReadBool(&m_fHGCMActive); } 68 #endif /* VBOX_WITH_HGCM */ 61 69 62 70 private: -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r47174 r47190 4420 4420 } 4421 4421 4422 VMMDevMouseInterface *Console::getVMMDevMouseInterface() 4423 { 4424 return m_pVMMDev; 4425 } 4426 4427 DisplayMouseInterface *Console::getDisplayMouseInterface() 4428 { 4429 return mDisplay; 4430 } 4422 4431 4423 4432 /** -
trunk/src/VBox/Main/src-client/MouseImpl.cpp
r47174 r47190 100 100 * @param parent handle of our parent object 101 101 */ 102 HRESULT Mouse::init (Console *parent)102 HRESULT Mouse::init (ConsoleMouseInterface *parent) 103 103 { 104 104 LogFlowThisFunc(("\n")); … … 159 159 uint32_t fCapsRemoved) 160 160 { 161 VMMDev *pVMMDev = mParent->getVMMDev();161 VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface(); 162 162 if (!pVMMDev) 163 163 return E_FAIL; /* No assertion, as the front-ends can send events … … 384 384 HRESULT Mouse::reportAbsEventToVMMDev(int32_t mouseXAbs, int32_t mouseYAbs) 385 385 { 386 VMMDev *pVMMDev = mParent->getVMMDev();386 VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface(); 387 387 ComAssertRet(pVMMDev, E_FAIL); 388 388 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); … … 510 510 AssertPtrReturn(pcY, E_POINTER); 511 511 AssertPtrNullReturn(pfValid, E_POINTER); 512 Display *pDisplay = mParent->getDisplay();512 DisplayMouseInterface *pDisplay = mParent->getDisplayMouseInterface(); 513 513 ComAssertRet(pDisplay, E_FAIL); 514 514 /** The amount to add to the result (multiplied by the screen width/height) … … 523 523 ULONG displayWidth, displayHeight; 524 524 /* Takes the display lock */ 525 HRESULT rc = pDisplay-> GetScreenResolution(0, &displayWidth,525 HRESULT rc = pDisplay->getScreenResolution(0, &displayWidth, 526 526 &displayHeight, NULL); 527 527 if (FAILED(rc)) -
trunk/src/VBox/Main/testcase/Makefile.kmk
r45052 r47190 31 31 $(if $(VBOX_WITH_RESOURCE_USAGE_API),tstCollector,) \ 32 32 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlParseBuffer,) \ 33 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) 33 $(if $(VBOX_WITH_GUEST_CONTROL),tstGuestCtrlContextID,) \ 34 $(if ,tstMouseImpl,) 34 35 PROGRAMS.linux += \ 35 36 $(if $(VBOX_WITH_USB),tstUSBProxyLinux,) … … 208 209 209 210 211 # 212 # tstMouseImpl 213 # 214 # Not yet enabled, as I still haven't managed to wrap everything into the test 215 # case. 216 # 217 tstMouseImpl_TEMPLATE = VBOXMAINCLIENTEXE 218 tstMouseImpl_INST = $(INST_TESTCASE) 219 tstMouseImpl_SOURCES = \ 220 tstMouseImpl.cpp \ 221 ../src-client/MouseImpl.cpp \ 222 ../src-all/EventImpl.cpp \ 223 ../src-all/VirtualBoxBase.cpp 224 tstMouseImpl_INCS = ../include \ 225 $(dir $(VBOX_XML_SCHEMADEFS_H)) 226 tstMouseImpl_LIBS = $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) 227 228 210 229 # generate rules. 211 230 include $(FILE_KBUILD_SUB_FOOTER) -
trunk/src/VBox/Main/testcase/tstMouseImpl.cpp
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/VBox-3.0/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 58652,70973 /branches/VBox-3.2/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 66309,66318 /branches/VBox-4.0/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 70873 /branches/VBox-4.1/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 74233,78414,78691,81841,82127 /branches/VBox-4.1/src/VBox/Frontends/VBoxHeadless/VBoxBFE/testcase/tstMouseImpl.cpp 82454 /branches/andy/guestctrl20/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 78916,78930 /branches/dsen/gui/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 79076-79078,79089,79109-79110,79112-79113,79127-79130,79134,79141,79151,79155,79157-79159,79193,79197 /branches/dsen/gui2/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644 /branches/dsen/gui3/src/VBox/Frontends/VBoxBFE/testcase/tstMouseImpl.cpp 79645-79692
r44579 r47190 29 29 #include <iprt/test.h> 30 30 31 /****************************************************************************** 32 * Test infrastructure * 33 ******************************************************************************/ 34 35 class TestConsole : public Console 31 NS_DECL_CLASSINFO(Mouse) 32 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse) 33 34 PDMIVMMDEVPORT VMMDevPort; 35 36 class TestVMMDev : public VMMDevMouseInterface 37 { 38 PPDMIVMMDEVPORT getVMMDevPort(void) { return &VMMDevPort; } 39 }; 40 41 class TestDisplay : public DisplayMouseInterface 42 { 43 void getFramebufferDimensions(int32_t *px1, int32_t *py1, 44 int32_t *px2, int32_t *py2); 45 int getScreenResolution(uint32_t cScreen, uint32_t *pcx, uint32_t *pcy, 46 uint32_t *pcBPP); 47 }; 48 49 class TestConsole : public ConsoleMouseInterface 36 50 { 37 51 public: 38 TestConsole() {} 39 ~TestConsole() {} 40 41 virtual void updateTitlebar() {} 42 virtual void updateTitlebarProgress(const char *, int) {} 43 44 virtual void inputGrabStart() {} 45 virtual void inputGrabEnd() {} 46 47 virtual void mouseSendEvent(int) {} 48 virtual void onMousePointerShapeChange(bool, bool, uint32_t, 49 uint32_t, uint32_t, 50 uint32_t, void *) {} 51 virtual void progressInfo(PVM, unsigned, void *) {} 52 53 virtual CONEVENT eventWait() 54 { 55 AssertFailedReturn(CONEVENT_QUIT); 56 } 57 virtual void eventQuit() {} 58 virtual void resetCursor() {} 59 virtual void resetKeys(void) {} 60 virtual VMMDev *getVMMDev() 61 { 62 return &mVMMDev; 63 } 64 virtual Display *getDisplay() 65 { 66 return &mDisplay; 67 } 52 VMMDevMouseInterface *getVMMDevMouseInterface() { return &mVMMDev; } 53 DisplayMouseInterface *getDisplayMouseInterface() { return &mDisplay; } 54 /** @todo why on earth is this not implemented? */ 55 void onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, 56 BOOL supportsMT, BOOL needsHostCursor) {} 68 57 69 58 private: 70 VMMDev mVMMDev;71 Display mDisplay;59 TestVMMDev mVMMDev; 60 TestDisplay mDisplay; 72 61 }; 73 62 … … 147 136 static struct PDMDRVINS *ppdmdrvIns = NULL; 148 137 149 PDMIVMMDEVPORT VMMDevPort;150 138 Mouse *pMouse; 151 Console *pConsole;139 ConsoleMouseInterface *pConsole; 152 140 153 141 static struct … … 169 157 } 170 158 171 PPDMIVMMDEVPORT VMMDev::getVMMDevPort(void) 172 { 173 return &VMMDevPort; 174 } 175 176 VMMDev::VMMDev() {} 177 178 VMMDev::~VMMDev() {} 179 180 void Display::getFramebufferDimensions(int32_t *px1, int32_t *py1, 181 int32_t *px2, int32_t *py2) 159 void TestDisplay::getFramebufferDimensions(int32_t *px1, int32_t *py1, 160 int32_t *px2, int32_t *py2) 182 161 { 183 162 if (px1) … … 191 170 } 192 171 193 STDMETHODIMP Display::GetScreenResolution(ULONG aScreenId, 194 ULONG *aWidth, 195 ULONG *aHeight, 196 ULONG *aBitsPerPixel) 197 { 198 if (aWidth) 199 *aWidth = 640; 200 if (aHeight) 201 *aHeight = 480; 202 if (aBitsPerPixel) 203 *aBitsPerPixel = 32; 172 int TestDisplay::getScreenResolution(uint32_t cScreen, uint32_t *pcx, 173 uint32_t *pcy, uint32_t *pcBPP) 174 { 175 NOREF(cScreen); 176 if (pcx) 177 *pcx = 640; 178 if (pcy) 179 *pcy = 480; 180 if (pcBPP) 181 *pcBPP = 32; 204 182 return S_OK; 205 183 } 206 207 Display::Display() {}208 209 Display::~Display() {}210 184 211 185 DECLEXPORT(bool) CFGMR3AreValuesValid(PCFGMNODE, const char *) … … 261 235 pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase, 262 236 PDMIMOUSECONNECTOR_IID); 263 pConnector->pfnReportModes(pConnector, true, false );237 pConnector->pfnReportModes(pConnector, true, false, false); 264 238 pMouse->onVMMDevGuestCapsChange( VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE 265 239 | VMMDEV_MOUSE_NEW_PROTOCOL); … … 292 266 pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase, 293 267 PDMIMOUSECONNECTOR_IID); 294 pConnector->pfnReportModes(pConnector, true, false );268 pConnector->pfnReportModes(pConnector, true, false, false); 295 269 pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE); 296 270 pMouse->PutMouseEventAbsolute(320, 240, 0, 0, 0); … … 322 296 pConnector = (PPDMIMOUSECONNECTOR)pBase->pfnQueryInterface(pBase, 323 297 PDMIMOUSECONNECTOR_IID); 324 pConnector->pfnReportModes(pConnector, false, true );298 pConnector->pfnReportModes(pConnector, false, true, false); 325 299 pMouse->onVMMDevGuestCapsChange( VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE 326 300 | VMMDEV_MOUSE_NEW_PROTOCOL); -
Property svn:mergeinfo
set to (toggle deleted branches)
Note:
See TracChangeset
for help on using the changeset viewer.