Changeset 28215 in vbox
- Timestamp:
- Apr 12, 2010 3:31:54 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59955
- Location:
- trunk/src/VBox
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp
r26980 r28215 205 205 } 206 206 207 STDMETHODIMP Display::COMGETTER(Width)(ULONG *pWidth) 208 { 209 *pWidth = getWidth(); 210 return S_OK; 211 } 212 213 STDMETHODIMP Display::COMGETTER(Height)(ULONG *pHeight) 214 { 215 *pHeight = getHeight(); 207 STDMETHODIMP Display::GetScreenResolution(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel) 208 { 209 if (aWidth) 210 *aWidth = getWidth(); 211 if (aHeight) 212 *aHeight = getHeight(); 213 if (aBitsPerPixel) 214 *aBitsPerPixel = getBitsPerPixel(); 216 215 return S_OK; 217 216 } -
trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h
r26980 r28215 58 58 STDMETHODIMP InvalidateAndUpdate(); 59 59 STDMETHODIMP ResizeCompleted(); 60 STDMETHODIMP COMGETTER(Width)(ULONG *pWidth); 61 STDMETHODIMP COMGETTER(Height)(ULONG *pHeight); 60 STDMETHODIMP GetScreenResolution(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel); 62 61 63 62 void resetFramebuffer(); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r28211 r28215 1172 1172 { 1173 1173 ULONG xRes, yRes, bpp; 1174 rc = display->COMGETTER(Width)(&xRes); 1175 if (rc == E_ACCESSDENIED) 1176 break; /* VM not powered up */ 1177 if (FAILED(rc)) 1178 { 1179 com::ErrorInfo info (display); 1180 GluePrintErrorInfo(info); 1181 return rc; 1182 } 1183 rc = display->COMGETTER(Height)(&yRes); 1184 if (rc == E_ACCESSDENIED) 1185 break; /* VM not powered up */ 1186 if (FAILED(rc)) 1187 { 1188 com::ErrorInfo info (display); 1189 GluePrintErrorInfo(info); 1190 return rc; 1191 } 1192 rc = display->COMGETTER(BitsPerPixel)(&bpp); 1174 rc = display->GetScreenResolution (0, &xRes, &yRes, &bpp); 1193 1175 if (rc == E_ACCESSDENIED) 1194 1176 break; /* VM not powered up */ -
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r28201 r28215 360 360 h = console.display.height 361 361 print "Saving screenshot (%d x %d) in %s..." %(w,h,f) 362 data = display.takeScreenShot Slow(w,h)362 data = display.takeScreenShotToArray(w,h) 363 363 size = (w,h) 364 364 mode = "RGBA" -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r28148 r28215 3353 3353 QImage shot = QImage (mFrameBuf->width(), mFrameBuf->height(), QImage::Format_RGB32); 3354 3354 CDisplay dsp = mConsole.GetDisplay(); 3355 dsp.TakeScreenShot ( shot.bits(), shot.width(), shot.height());3355 dsp.TakeScreenShot (0, shot.bits(), shot.width(), shot.height()); 3356 3356 /* 3357 3357 * TakeScreenShot() may fail if, e.g. the Paused notification -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r27873 r28215 2621 2621 2622 2622 CDisplay dsp = console.GetDisplay(); 2623 QImage shot = QImage (dsp.GetWidth(), dsp.GetHeight(), QImage::Format_RGB32); 2624 dsp.TakeScreenShot (shot.bits(), shot.width(), shot.height()); 2623 ULONG width = 0; 2624 ULONG height = 0; 2625 ULONG bpp = 0; 2626 dsp.GetScreenResolution(0, width, height, bpp); 2627 QImage shot = QImage (width, height, QImage::Format_RGB32); 2628 dsp.TakeScreenShot (0, shot.bits(), shot.width(), shot.height()); 2625 2629 shot.save (QFile::encodeName (fname), "PNG"); 2626 2630 … … 3306 3310 * _1M /* mb to bytes */ 3307 3311 * 8; /* to bits */ 3308 ULONG guestBpp = mConsole->console().GetDisplay().GetBitsPerPixel(); 3312 ULONG width = 0; 3313 ULONG height = 0; 3314 ULONG guestBpp = 0; 3315 mConsole->console().GetDisplay().GetScreenResolution(0, width, height, guestBpp); 3309 3316 ULONG64 usedBits = (screen.width() /* display width */ 3310 3317 * screen.height() /* display height */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
r27223 r28215 555 555 { 556 556 CConsole console = mSession.GetConsole(); 557 ULONG bpp = console.GetDisplay().GetBitsPerPixel(); 557 ULONG width = 0; 558 ULONG height = 0; 559 ULONG bpp = 0; 560 console.GetDisplay().GetScreenResolution(0, width, height, bpp); 558 561 QString resolution = QString ("%1x%2") 559 .arg ( console.GetDisplay().GetWidth())560 .arg ( console.GetDisplay().GetHeight());562 .arg (width) 563 .arg (height); 561 564 if (bpp) 562 565 resolution += QString ("x%1").arg (bpp); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r28020 r28215 632 632 QString strFileName = strLogFolder + "/VBox.png"; 633 633 CDisplay display = console.GetDisplay(); 634 QImage shot = QImage(display.GetWidth(), display.GetHeight(), QImage::Format_RGB32); 635 display.TakeScreenShot(shot.bits(), shot.width(), shot.height()); 634 ULONG width = 0; 635 ULONG height = 0; 636 ULONG bpp = 0; 637 display.GetScreenResolution(0, width, height, bpp); 638 QImage shot = QImage(width, height, QImage::Format_RGB32); 639 display.TakeScreenShot(0, shot.bits(), shot.width(), shot.height()); 636 640 shot.save(QFile::encodeName(strFileName), "PNG"); 637 641 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r28148 r28215 1227 1227 QImage shot = QImage(m_pFrameBuffer->width(), m_pFrameBuffer->height(), QImage::Format_RGB32); 1228 1228 CDisplay dsp = session().GetConsole().GetDisplay(); 1229 dsp.TakeScreenShot(s hot.bits(), shot.width(), shot.height());1229 dsp.TakeScreenShot(screenId(), shot.bits(), shot.width(), shot.height()); 1230 1230 /* TakeScreenShot() may fail if, e.g. the Paused notification was delivered 1231 1231 * after the machine execution was resumed. It's not fatal: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r27420 r28215 203 203 quint64 UIMultiScreenLayout::memoryRequirements(const QMap<int, int> *pScreenLayout) const 204 204 { 205 int guestBpp = m_pMachineLogic->uisession()->session().GetConsole().GetDisplay().GetBitsPerPixel(); 205 ULONG width = 0; 206 ULONG height = 0; 207 ULONG guestBpp = 0; 208 m_pMachineLogic->uisession()->session().GetConsole().GetDisplay().GetScreenResolution(0, width, height, guestBpp); 206 209 quint64 usedBits = 0; 207 210 for (int i = 0; i < m_cGuestScreens; ++ i) -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r27889 r28215 217 217 } 218 218 219 CHECK_ERROR(pDisplay, DrawToScreen( data, 0, 0, 100, 100));219 CHECK_ERROR(pDisplay, DrawToScreen(screenId, data, 0, 0, 100, 100)); 220 220 221 221 RTMemTmpFree(data); … … 225 225 226 226 CHECK_ERROR(g_pConsole, COMGETTER(Display)(pDisplay.asOutParam())); 227 CHECK_ERROR(pDisplay, DrawToScreen( (BYTE*)data, x, y, w, h));227 CHECK_ERROR(pDisplay, DrawToScreen(screenId, (BYTE*)data, x, y, w, h)); 228 228 } 229 229 -
trunk/src/VBox/Main/DisplayImpl.cpp
r27905 r28215 1980 1980 1981 1981 1982 // IDisplay properties1982 // IDisplay methods 1983 1983 ///////////////////////////////////////////////////////////////////////////// 1984 1985 /** 1986 * Returns the current display width in pixel 1987 * 1988 * @returns COM status code 1989 * @param width Address of result variable. 1990 */ 1991 STDMETHODIMP Display::COMGETTER(Width) (ULONG *width) 1992 { 1993 CheckComArgNotNull(width); 1984 STDMETHODIMP Display::GetScreenResolution (ULONG aScreenId, 1985 ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel) 1986 { 1987 LogFlowFunc (("aScreenId = %d\n", aScreenId)); 1994 1988 1995 1989 AutoCaller autoCaller(this); 1996 1990 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1997 1991 1998 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1999 2000 CHECK_CONSOLE_DRV (mpDrv); 2001 2002 *width = mpDrv->IConnector.cx; 1992 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1993 1994 uint32_t u32Width = 0; 1995 uint32_t u32Height = 0; 1996 uint32_t u32BitsPerPixel = 0; 1997 1998 if (aScreenId == VBOX_VIDEO_PRIMARY_SCREEN) 1999 { 2000 CHECK_CONSOLE_DRV (mpDrv); 2001 2002 u32Width = mpDrv->IConnector.cx; 2003 u32Height = mpDrv->IConnector.cy; 2004 int rc = mpDrv->pUpPort->pfnQueryColorDepth(mpDrv->pUpPort, &u32BitsPerPixel); 2005 AssertRC(rc); 2006 } 2007 else if (aScreenId < mcMonitors) 2008 { 2009 DISPLAYFBINFO *pFBInfo = &maFramebuffers[aScreenId]; 2010 u32Width = pFBInfo->w; 2011 u32Height = pFBInfo->h; 2012 u32BitsPerPixel = pFBInfo->u16BitsPerPixel; 2013 } 2014 else 2015 { 2016 return E_INVALIDARG; 2017 } 2018 2019 if (aWidth) 2020 *aWidth = u32Width; 2021 if (aHeight) 2022 *aHeight = u32Height; 2023 if (aBitsPerPixel) 2024 *aBitsPerPixel = u32BitsPerPixel; 2003 2025 2004 2026 return S_OK; 2005 2027 } 2006 2007 /**2008 * Returns the current display height in pixel2009 *2010 * @returns COM status code2011 * @param height Address of result variable.2012 */2013 STDMETHODIMP Display::COMGETTER(Height) (ULONG *height)2014 {2015 CheckComArgNotNull(height);2016 2017 AutoCaller autoCaller(this);2018 if (FAILED(autoCaller.rc())) return autoCaller.rc();2019 2020 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2021 2022 CHECK_CONSOLE_DRV (mpDrv);2023 2024 *height = mpDrv->IConnector.cy;2025 2026 return S_OK;2027 }2028 2029 /**2030 * Returns the current display color depth in bits2031 *2032 * @returns COM status code2033 * @param bitsPerPixel Address of result variable.2034 */2035 STDMETHODIMP Display::COMGETTER(BitsPerPixel) (ULONG *bitsPerPixel)2036 {2037 if (!bitsPerPixel)2038 return E_INVALIDARG;2039 2040 AutoCaller autoCaller(this);2041 if (FAILED(autoCaller.rc())) return autoCaller.rc();2042 2043 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2044 2045 CHECK_CONSOLE_DRV (mpDrv);2046 2047 uint32_t cBits = 0;2048 int rc = mpDrv->pUpPort->pfnQueryColorDepth(mpDrv->pUpPort, &cBits);2049 AssertRC(rc);2050 *bitsPerPixel = cBits;2051 2052 return S_OK;2053 }2054 2055 2056 // IDisplay methods2057 /////////////////////////////////////////////////////////////////////////////2058 2028 2059 2029 STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId, … … 2278 2248 } 2279 2249 2280 STDMETHODIMP Display::TakeScreenShot ( BYTE *address, ULONG width, ULONG height)2250 STDMETHODIMP Display::TakeScreenShot (ULONG aScreenId, BYTE *address, ULONG width, ULONG height) 2281 2251 { 2282 2252 /// @todo (r=dmik) this function may take too long to complete if the VM … … 2333 2303 } 2334 2304 2335 STDMETHODIMP Display::TakeScreenShot Slow (ULONG width, ULONG height,2305 STDMETHODIMP Display::TakeScreenShotToArray (ULONG aScreenId, ULONG width, ULONG height, 2336 2306 ComSafeArrayOut(BYTE, aScreenData)) 2337 2307 { … … 2420 2390 #endif /* VBOX_WITH_OLD_VBVA_LOCK */ 2421 2391 2422 STDMETHODIMP Display::DrawToScreen ( BYTE *address, ULONG x, ULONG y,2392 STDMETHODIMP Display::DrawToScreen (ULONG aScreenId, BYTE *address, ULONG x, ULONG y, 2423 2393 ULONG width, ULONG height) 2424 2394 { … … 2570 2540 ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress); 2571 2541 AssertRelease(f);NOREF(f); 2572 2573 return S_OK;2574 }2575 2576 /**2577 * Notification that the framebuffer has completed the2578 * asynchronous update processing2579 *2580 * @returns COM status code2581 */2582 STDMETHODIMP Display::UpdateCompleted()2583 {2584 LogFlowFunc (("\n"));2585 2586 /// @todo (dmik) can we AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); here?2587 // do it when we switch this class to VirtualBoxBase_NEXT.2588 // Tthis will require general code review and may add some details.2589 // In particular, we may want to check whether EMT is really waiting for2590 // this notification, etc. It might be also good to obey the caller to make2591 // sure this method is not called from more than one thread at a time2592 // (and therefore don't use Display lock at all here to save some2593 // milliseconds).2594 AutoCaller autoCaller(this);2595 if (FAILED(autoCaller.rc())) return autoCaller.rc();2596 2597 /* this is only valid for external framebuffers */2598 if (maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN].pFramebuffer == NULL)2599 return setError(VBOX_E_NOT_SUPPORTED,2600 tr("Resize completed notification is valid only for external framebuffers"));2601 2542 2602 2543 return S_OK; -
trunk/src/VBox/Main/MouseImpl.cpp
r27607 r28215 409 409 410 410 ULONG displayWidth; 411 HRESULT rc = pDisplay-> COMGETTER(Width)(&displayWidth);411 HRESULT rc = pDisplay->GetScreenResolution (0, &displayWidth, NULL, NULL); 412 412 if (FAILED(rc)) return rc; 413 413 … … 429 429 430 430 ULONG displayHeight; 431 HRESULT rc = pDisplay-> COMGETTER(Height)(&displayHeight);431 HRESULT rc = pDisplay->GetScreenResolution (0, NULL, &displayHeight, NULL); 432 432 if (FAILED(rc)) return rc; 433 433 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r28205 r28215 11314 11314 <interface 11315 11315 name="IDisplay" extends="$unknown" 11316 uuid=" e2a38ebc-d854-4a3e-bc2e-fdf5ac4a0000"11316 uuid="1fa79e39-0cc9-4ab3-9df3-ed3e96b42496" 11317 11317 wsmap="managed" 11318 11318 > … … 11328 11328 the host computer or an RDP session's display on a remote computer. 11329 11329 </desc> 11330 <attribute name="width" type="unsigned long" readonly="yes"> 11331 <desc>Current display width.</desc> 11332 </attribute> 11333 11334 <attribute name="height" type="unsigned long" readonly="yes"> 11335 <desc>Current display height.</desc> 11336 </attribute> 11337 11338 <attribute name="bitsPerPixel" type="unsigned long" readonly="yes"> 11339 <desc> 11340 Current guest display color depth. Note that this may differ 11341 from <link to="IFramebuffer::bitsPerPixel"/>. 11342 </desc> 11343 </attribute> 11330 <method name="getScreenResolution"> 11331 <desc>Queries display width, height and color depth for given screen.</desc> 11332 <param name="screenId" type="unsigned long" dir="in"/> 11333 <param name="width" type="unsigned long" dir="out"/> 11334 <param name="height" type="unsigned long" dir="out"/> 11335 <param name="bitsPerPixel" type="unsigned long" dir="out"/> 11336 </method> 11344 11337 11345 11338 <method name="setFramebuffer"> … … 11422 11415 11423 11416 </desc> 11417 <param name="screenId" type="unsigned long" dir="in"/> 11424 11418 <param name="address" type="octet" mod="ptr" dir="in"/> 11425 11419 <param name="width" type="unsigned long" dir="in"/> … … 11427 11421 </method> 11428 11422 11429 <method name="takeScreenShot Slow">11423 <method name="takeScreenShotToArray"> 11430 11424 <desc> 11431 11425 Takes a guest screen shot of the requested size and returns it as … … 11444 11438 </result> 11445 11439 </desc> 11440 <param name="screenId" type="unsigned long" dir="in"/> 11446 11441 <param name="width" type="unsigned long" dir="in"> 11447 11442 <desc> … … 11474 11469 11475 11470 </desc> 11471 <param name="screenId" type="unsigned long" dir="in"/> 11476 11472 <param name="address" type="octet" mod="ptr" dir="in"/> 11477 11473 <param name="x" type="unsigned long" dir="in"/> … … 11503 11499 </desc> 11504 11500 <param name="screenId" type="unsigned long" dir="in"/> 11505 </method>11506 11507 <method name="updateCompleted">11508 <desc>11509 Signals that a framebuffer has completed the update operation.11510 11511 <result name="VBOX_E_NOT_SUPPORTED">11512 Operation only valid for external frame buffers.11513 </result>11514 11515 </desc>11516 11501 </method> 11517 11502 -
trunk/src/VBox/Main/include/DisplayImpl.h
r27751 r28215 246 246 } 247 247 248 // IDisplay properties249 STDMETHOD(COMGETTER(Width)) (ULONG *width);250 STDMETHOD(COMGETTER(Height)) (ULONG *height);251 STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *bitsPerPixel);252 253 248 // IDisplay methods 249 STDMETHOD(GetScreenResolution)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel); 254 250 STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer); 255 251 STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin); 256 252 STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG bitsPerPixel, ULONG display); 257 STDMETHOD(TakeScreenShot)( BYTE *address, ULONG width, ULONG height);258 STDMETHOD(TakeScreenShot Slow)(ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData));259 STDMETHOD(DrawToScreen)( BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);253 STDMETHOD(TakeScreenShot)(ULONG aScreenId, BYTE *address, ULONG width, ULONG height); 254 STDMETHOD(TakeScreenShotToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData)); 255 STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height); 260 256 STDMETHOD(InvalidateAndUpdate)(); 261 257 STDMETHOD(ResizeCompleted)(ULONG aScreenId); 262 STDMETHOD(UpdateCompleted)();263 258 STDMETHOD(SetSeamlessMode)(BOOL enabled); 264 259
Note:
See TracChangeset
for help on using the changeset viewer.