VirtualBox

Changeset 28215 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 12, 2010 3:31:54 PM (15 years ago)
Author:
vboxsync
Message:

IDisplay API changes for multimonitor (xTracker 4655)

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r27905 r28215  
    19801980
    19811981
    1982 // IDisplay properties
     1982// IDisplay methods
    19831983/////////////////////////////////////////////////////////////////////////////
    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);
     1984STDMETHODIMP Display::GetScreenResolution (ULONG aScreenId,
     1985    ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel)
     1986{
     1987    LogFlowFunc (("aScreenId = %d\n", aScreenId));
    19941988
    19951989    AutoCaller autoCaller(this);
    19961990    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    19971991
    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;
    20032025
    20042026    return S_OK;
    20052027}
    2006 
    2007 /**
    2008  * Returns the current display height in pixel
    2009  *
    2010  * @returns COM status code
    2011  * @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 bits
    2031  *
    2032  * @returns COM status code
    2033  * @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 methods
    2057 /////////////////////////////////////////////////////////////////////////////
    20582028
    20592029STDMETHODIMP Display::SetFramebuffer (ULONG aScreenId,
     
    22782248}
    22792249
    2280 STDMETHODIMP Display::TakeScreenShot (BYTE *address, ULONG width, ULONG height)
     2250STDMETHODIMP Display::TakeScreenShot (ULONG aScreenId, BYTE *address, ULONG width, ULONG height)
    22812251{
    22822252    /// @todo (r=dmik) this function may take too long to complete if the VM
     
    23332303}
    23342304
    2335 STDMETHODIMP Display::TakeScreenShotSlow (ULONG width, ULONG height,
     2305STDMETHODIMP Display::TakeScreenShotToArray (ULONG aScreenId, ULONG width, ULONG height,
    23362306                                          ComSafeArrayOut(BYTE, aScreenData))
    23372307{
     
    24202390#endif /* VBOX_WITH_OLD_VBVA_LOCK */
    24212391
    2422 STDMETHODIMP Display::DrawToScreen (BYTE *address, ULONG x, ULONG y,
     2392STDMETHODIMP Display::DrawToScreen (ULONG aScreenId, BYTE *address, ULONG x, ULONG y,
    24232393                                    ULONG width, ULONG height)
    24242394{
     
    25702540        ResizeStatus_UpdateDisplayData, ResizeStatus_InProgress);
    25712541    AssertRelease(f);NOREF(f);
    2572 
    2573     return S_OK;
    2574 }
    2575 
    2576 /**
    2577  * Notification that the framebuffer has completed the
    2578  * asynchronous update processing
    2579  *
    2580  * @returns COM status code
    2581  */
    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 for
    2590     //  this notification, etc. It might be also good to obey the caller to make
    2591     //  sure this method is not called from more than one thread at a time
    2592     //  (and therefore don't use Display lock at all here to save some
    2593     //  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"));
    26012542
    26022543    return S_OK;
  • trunk/src/VBox/Main/MouseImpl.cpp

    r27607 r28215  
    409409
    410410    ULONG displayWidth;
    411     HRESULT rc = pDisplay->COMGETTER(Width)(&displayWidth);
     411    HRESULT rc = pDisplay->GetScreenResolution (0, &displayWidth, NULL, NULL);
    412412    if (FAILED(rc)) return rc;
    413413
     
    429429
    430430    ULONG displayHeight;
    431     HRESULT rc = pDisplay->COMGETTER(Height)(&displayHeight);
     431    HRESULT rc = pDisplay->GetScreenResolution (0, NULL, &displayHeight, NULL);
    432432    if (FAILED(rc)) return rc;
    433433
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r28205 r28215  
    1131411314  <interface
    1131511315     name="IDisplay" extends="$unknown"
    11316      uuid="e2a38ebc-d854-4a3e-bc2e-fdf5ac4a0000"
     11316     uuid="1fa79e39-0cc9-4ab3-9df3-ed3e96b42496"
    1131711317     wsmap="managed"
    1131811318     >
     
    1132811328      the host computer or an RDP session's display on a remote computer.
    1132911329    </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>
    1134411337
    1134511338    <method name="setFramebuffer">
     
    1142211415
    1142311416      </desc>
     11417      <param name="screenId" type="unsigned long" dir="in"/>
    1142411418      <param name="address" type="octet" mod="ptr" dir="in"/>
    1142511419      <param name="width" type="unsigned long" dir="in"/>
     
    1142711421    </method>
    1142811422
    11429     <method name="takeScreenShotSlow">
     11423    <method name="takeScreenShotToArray">
    1143011424      <desc>
    1143111425        Takes a guest screen shot of the requested size and returns it as
     
    1144411438        </result>
    1144511439      </desc>
     11440      <param name="screenId" type="unsigned long" dir="in"/>
    1144611441      <param name="width" type="unsigned long" dir="in">
    1144711442        <desc>
     
    1147411469
    1147511470      </desc>
     11471      <param name="screenId" type="unsigned long" dir="in"/>
    1147611472      <param name="address" type="octet" mod="ptr" dir="in"/>
    1147711473      <param name="x" type="unsigned long" dir="in"/>
     
    1150311499      </desc>
    1150411500      <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>
    1151611501    </method>
    1151711502
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r27751 r28215  
    246246    }
    247247
    248     // IDisplay properties
    249     STDMETHOD(COMGETTER(Width)) (ULONG *width);
    250     STDMETHOD(COMGETTER(Height)) (ULONG *height);
    251     STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *bitsPerPixel);
    252 
    253248    // IDisplay methods
     249    STDMETHOD(GetScreenResolution)(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel);
    254250    STDMETHOD(SetFramebuffer)(ULONG aScreenId, IFramebuffer *aFramebuffer);
    255251    STDMETHOD(GetFramebuffer)(ULONG aScreenId, IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin);
    256252    STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG bitsPerPixel, ULONG display);
    257     STDMETHOD(TakeScreenShot)(BYTE *address, ULONG width, ULONG height);
    258     STDMETHOD(TakeScreenShotSlow)(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);
    260256    STDMETHOD(InvalidateAndUpdate)();
    261257    STDMETHOD(ResizeCompleted)(ULONG aScreenId);
    262     STDMETHOD(UpdateCompleted)();
    263258    STDMETHOD(SetSeamlessMode)(BOOL enabled);
    264259
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette