Changeset 28215 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 12, 2010 3:31:54 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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.