VirtualBox

Changeset 52978 in vbox


Ignore:
Timestamp:
Oct 8, 2014 7:09:11 AM (10 years ago)
Author:
vboxsync
Message:

IDisplay::GetScreenResolution returns status of the guest monitor.

Location:
trunk/src/VBox
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r52200 r52978  
    13321332            ULONG width, height, bpp;
    13331333            LONG xOrigin, yOrigin;
    1334             CHECK_ERROR_BREAK(pDisplay, GetScreenResolution(iScreen, &width, &height, &bpp, &xOrigin, &yOrigin));
     1334            GuestMonitorStatus_T monitorStatus;
     1335            CHECK_ERROR_BREAK(pDisplay, GetScreenResolution(iScreen, &width, &height, &bpp, &xOrigin, &yOrigin, &monitorStatus));
    13351336            com::SafeArray<BYTE> saScreenshot;
    13361337            CHECK_ERROR_BREAK(pDisplay, TakeScreenShotToArray(iScreen, width, height, BitmapFormat_PNG, ComSafeArrayAsOutParam(saScreenshot)));
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r52037 r52978  
    16821682            ULONG xRes, yRes, bpp;
    16831683            LONG xOrigin, yOrigin;
    1684             rc = display->GetScreenResolution(0, &xRes, &yRes, &bpp, &xOrigin, &yOrigin);
     1684            GuestMonitorStatus_T monitorStatus;
     1685            rc = display->GetScreenResolution(0, &xRes, &yRes, &bpp, &xOrigin, &yOrigin, &monitorStatus);
    16851686            if (rc == E_ACCESSDENIED)
    16861687                break; /* VM not powered up */
     
    16921693            }
    16931694            if (details == VMINFO_MACHINEREADABLE)
    1694                 RTPrintf("VideoMode=\"%d,%d,%d\"@%d,%d\n", xRes, yRes, bpp, xOrigin, yOrigin);
    1695             else
    1696                 RTPrintf("Video mode:      %dx%dx%d at %d,%d\n", xRes, yRes, bpp, xOrigin, yOrigin);
     1695                RTPrintf("VideoMode=\"%d,%d,%d\"@%d,%d %d\n", xRes, yRes, bpp, xOrigin, yOrigin, monitorStatus);
     1696            else
     1697            {
     1698                const char *pszMonitorStatus = "unknown status";
     1699                switch (monitorStatus)
     1700                {
     1701                    case GuestMonitorStatus_Enabled:  pszMonitorStatus = "enabled"; break;
     1702                    case GuestMonitorStatus_Disabled: pszMonitorStatus = "disabled"; break;
     1703                    default: break;
     1704                }
     1705                RTPrintf("Video mode:      %dx%dx%d at %d,%d %s\n", xRes, yRes, bpp, xOrigin, yOrigin, pszMonitorStatus);
     1706            }
    16971707        }
    16981708        while (0);
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r52922 r52978  
    20162016        ULONG dummy;
    20172017        LONG xOrigin, yOrigin;
    2018         rc = gpDisplay->GetScreenResolution(i, &dummy, &dummy, &dummy, &xOrigin, &yOrigin);
     2018        GuestMonitorStatus_T monitorStatus;
     2019        rc = gpDisplay->GetScreenResolution(i, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);
    20192020        gpFramebuffer[i]->setOrigin(xOrigin, yOrigin);
    20202021    }
     
    22952296                        /* update xOrigin, yOrigin -> mouse */
    22962297                        ULONG dummy;
    2297                         rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin);
     2298                        GuestMonitorStatus_T monitorStatus;
     2299                        rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);
    22982300                        gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin);
    22992301                        break;
     
    28142816                /* update xOrigin, yOrigin -> mouse */
    28152817                ULONG dummy;
    2816                 rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin);
     2818                GuestMonitorStatus_T monitorStatus;
     2819                rc = gpDisplay->GetScreenResolution(event.user.code, &dummy, &dummy, &dummy, &xOrigin, &yOrigin, &monitorStatus);
    28172820                gpFramebuffer[event.user.code]->setOrigin(xOrigin, yOrigin);
    28182821                break;
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r52200 r52978  
    545545    else:
    546546        screen = 0
    547     (fbw, fbh, _fbbpp, fbx, fby) = display.getScreenResolution(screen)
     547    (fbw, fbh, _fbbpp, fbx, fby, _) = display.getScreenResolution(screen)
    548548    if len(args) > 1:
    549549        w = int(args[1])
     
    572572    else:
    573573        screen = 0
    574     (fbw, fbh, _fbbpp, fbx, fby) = display.getScreenResolution(screen)
     574    (fbw, fbh, _fbbpp, fbx, fby, _) = display.getScreenResolution(screen)
    575575    if len(args) > 1:
    576576        w = int(args[1])
  • trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp

    r52733 r52978  
    575575        LONG xOrigin = 0;
    576576        LONG yOrigin = 0;
    577         console.GetDisplay().GetScreenResolution(0, uWidth, uHeight, uBpp, xOrigin, yOrigin);
     577        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     578        console.GetDisplay().GetScreenResolution(0, uWidth, uHeight, uBpp, xOrigin, yOrigin, monitorStatus);
    578579        QString strResolution = QString("%1x%2").arg(uWidth).arg(uHeight);
    579580        if (uBpp)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp

    r52904 r52978  
    643643        LONG xOrigin = 0;
    644644        LONG yOrigin = 0;
     645        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    645646        CDisplay display = m_pMachineView->uisession()->session().GetConsole().GetDisplay();
    646647        display.GetScreenResolution(m_pMachineView->screenId(),
    647                                     ulWidth, ulHeight, ulGuestBitsPerPixel, xOrigin, yOrigin);
     648                                    ulWidth, ulHeight, ulGuestBitsPerPixel, xOrigin, yOrigin, monitorStatus);
    648649
    649650        /* Remind user if necessary, ignore text and VGA modes: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r52937 r52978  
    23422342        LONG xOrigin = 0;
    23432343        LONG yOrigin = 0;
    2344         display.GetScreenResolution(i, width, height, bpp, xOrigin, yOrigin);
     2344        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     2345        display.GetScreenResolution(i, width, height, bpp, xOrigin, yOrigin, monitorStatus);
    23452346        uMaxWidth  += width;
    23462347        uMaxHeight  = RT_MAX(uMaxHeight, height);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r52733 r52978  
    962962            LONG xShift = 0, yShift = 0;
    963963            ULONG dummy;
    964             session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift);
     964            KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     965            session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus);
    965966            /* Set shifting: */
    966967            cpnt.setX(cpnt.x() + xShift);
     
    10271028    LONG xShift = 0, yShift = 0;
    10281029    ULONG dummy;
    1029     session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift);
     1030    KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     1031    session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus);
    10301032
    10311033    /* Pass all multi-touch events into guest: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r52730 r52978  
    317317        else
    318318            screen = QApplication::desktop()->screenGeometry(screenLayout.value(iGuestScreen, 0));
    319         display.GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin);
     319        KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     320        display.GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin, monitorStatus);
    320321        usedBits += screen.width() * /* display width */
    321322                    screen.height() * /* display height */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r52730 r52978  
    205205    ULONG uWidth, uHeight, uBitsPerPixel;
    206206    LONG uOriginX, uOriginY;
     207    KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    207208    CDisplay display = session().GetConsole().GetDisplay();
    208     display.GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY);
     209    display.GetScreenResolution(iIndex, uWidth, uHeight, uBitsPerPixel, uOriginX, uOriginY, monitorStatus);
    209210    if (!fEnabled)
    210211        display.SetVideoModeHint(iIndex, false, false, 0, 0, 0, 0, 0);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp

    r52952 r52978  
    241241                    LONG iOriginX, iOriginY;
    242242                    ULONG uGuestWidth, uGuestHeight, uBpp;
    243                     display.GetScreenResolution(0, uGuestWidth, uGuestHeight, uBpp, iOriginX, iOriginY);
     243                    KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
     244                    display.GetScreenResolution(0, uGuestWidth, uGuestHeight, uBpp, iOriginX, iOriginY, monitorStatus);
    244245                    double dAspectRatio = (double)uGuestWidth / uGuestHeight;
    245246                    /* Look for the best aspect-ratio preset preset: */
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r52429 r52978  
    11251125                            CHECK_ERROR_RET(pFramebuffer, COMGETTER(Height)(&h), rc);
    11261126                            ULONG dummy;
    1127                             CHECK_ERROR_RET(pDisplay, GetScreenResolution(i, &dummy, &dummy, &dummy, &xo, &yo), rc);
     1127                            GuestMonitorStatus_T monitorStatus;
     1128                            CHECK_ERROR_RET(pDisplay, GetScreenResolution(i, &dummy, &dummy, &dummy, &xo, &yo, &monitorStatus), rc);
    11281129
    11291130                            rc = crVBoxServerMapScreen(i, xo, yo, w, h, winId);
     
    12521253                            CHECK_ERROR_BREAK(pFramebuffer, COMGETTER(Height)(&h));
    12531254                            ULONG dummy;
    1254                             CHECK_ERROR_BREAK(pDisplay, GetScreenResolution(screenId, &dummy, &dummy, &dummy, &xo, &yo));
     1255                            GuestMonitorStatus_T monitorStatus;
     1256                            CHECK_ERROR_BREAK(pDisplay, GetScreenResolution(screenId, &dummy, &dummy, &dummy, &xo, &yo, &monitorStatus));
    12551257
    12561258                            rc = crVBoxServerMapScreen(screenId, xo, yo, w, h, winId);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r52958 r52978  
    1570015700  </interface>
    1570115701
     15702  <enum
     15703    name="GuestMonitorStatus"
     15704    uuid="a0001cb1-97c9-496d-82bc-616c19a9e212"
     15705    >
     15706    <desc>
     15707      The current status of the guest display.
     15708    </desc>
     15709
     15710    <const name="Disabled" value="0">
     15711      <desc>
     15712        The guest monitor is disabled in the guest.
     15713      </desc>
     15714    </const>
     15715
     15716    <const name="Enabled" value="1">
     15717      <desc>
     15718        The guest monitor is enabled in the guest.
     15719      </desc>
     15720    </const>
     15721  </enum>
     15722
    1570215723  <interface
    1570315724    name="IDisplay" extends="$unknown"
    15704     uuid="fb51010f-eefd-430d-8cd7-3c1bc14740eb"
     15725    uuid="dc19253d-e6b8-4b2c-8923-c8ecf80d1909"
    1570515726    wsmap="managed"
    1570615727    wrap-hint-server-addinterfaces="IEventListener"
     
    1573315754      <param name="xOrigin" type="long" dir="out"/>
    1573415755      <param name="yOrigin" type="long" dir="out"/>
     15756      <param name="guestMonitorStatus" type="GuestMonitorStatus" dir="out"/>
    1573515757    </method>
    1573615758
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r52901 r52978  
    194194                                          ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin)
    195195    {
    196         return getScreenResolution(cScreen, pcx, pcy, pcBPP, pXOrigin, pYOrigin);
     196        return getScreenResolution(cScreen, pcx, pcy, pcBPP, pXOrigin, pYOrigin, NULL);
    197197    }
    198198    virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1,
     
    210210                                        ULONG *aBitsPerPixel,
    211211                                        LONG *aXOrigin,
    212                                         LONG *aYOrigin);
     212                                        LONG *aYOrigin,
     213                                        GuestMonitorStatus_T *aGuestMonitorStatus);
    213214    virtual HRESULT attachFramebuffer(ULONG aScreenId,
    214215                                      const ComPtr<IFramebuffer> &aFramebuffer);
  • trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp

    r52923 r52978  
    11041104        {
    11051105            ULONG dummy;
     1106            GuestMonitorStatus_T monitorStatus;
    11061107            hr = server->mConsole->i_getDisplay()->GetScreenResolution(uScreenId, &dummy, &dummy, &dummy,
    1107                                                                      &xOrigin, &yOrigin);
     1108                                                                       &xOrigin, &yOrigin, &monitorStatus);
    11081109
    11091110            if (SUCCEEDED(hr))
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r52934 r52978  
    14481448/////////////////////////////////////////////////////////////////////////////
    14491449HRESULT Display::getScreenResolution(ULONG aScreenId, ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel,
    1450                                      LONG *aXOrigin, LONG *aYOrigin)
     1450                                     LONG *aXOrigin, LONG *aYOrigin, GuestMonitorStatus_T *aGuestMonitorStatus)
    14511451{
    14521452    LogRelFlowFunc(("aScreenId=%RU32\n", aScreenId));
     
    14591459    int32_t xOrigin = 0;
    14601460    int32_t yOrigin = 0;
     1461    bool fEnabled = true;
    14611462
    14621463    if (aScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     
    14831484        xOrigin = pFBInfo->xOrigin;
    14841485        yOrigin = pFBInfo->yOrigin;
     1486        fEnabled = !RT_BOOL(pFBInfo->flags & VBVA_SCREEN_F_DISABLED);
    14851487    }
    14861488    else
     
    14991501    if (aYOrigin)
    15001502        *aYOrigin = yOrigin;
     1503    if (aGuestMonitorStatus)
     1504        *aGuestMonitorStatus = fEnabled? GuestMonitorStatus_Enabled: GuestMonitorStatus_Disabled;
    15011505
    15021506    return S_OK;
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r52082 r52978  
    478478    ULONG dummy;
    479479    LONG xShift, yShift;
     480    GuestMonitorStatus_T monitorStatus;
    480481    hr = pDisplay->GetScreenResolution(uScreenId, &dummy, &dummy, &dummy,
    481                                        &xShift, &yShift);
     482                                       &xShift, &yShift, &monitorStatus);
    482483    if (FAILED(hr))
    483484        return hr;
  • trunk/src/VBox/Main/webservice/samples/php/clienttest.php

    r52200 r52978  
    5858            $console = $session->console;
    5959            $display = $console->display;
    60             list($screenWidth, $screenHeight, $screenBpp, $screenX, $screenY) = $display->getScreenResolution(0 /* First screen */);             
     60            list($screenWidth, $screenHeight, $screenBpp, $screenX, $screenY, $screenStatus) = $display->getScreenResolution(0 /* First screen */);
    6161
    6262            $imageraw = $display->takeScreenShotToArray(0 /* First screen */, $screenWidth, $screenHeight, "RGBA");
    6363            echo "Screenshot size: " . sizeof($imageraw) . "\n";
    64            
     64
    6565            $filename = 'screenshot.png';
    6666            echo "Saving screenshot of " . $machine->name . " (${screenWidth}x${screenHeight}, ${screenBpp}BPP) to $filename\n";
  • trunk/src/VBox/Main/webservice/samples/python/clienttest.py

    r47774 r52978  
    101101                # Get the VM's current display resolution + bit depth + position
    102102                screenNum = 0 # From first screen
    103                 (screenW, screenH, screenBPP, screenX, screenY) = display.getScreenResolution(screenNum)
     103                (screenW, screenH, screenBPP, screenX, screenY, _) = display.getScreenResolution(screenNum)
    104104                print "    Display (%d):     %dx%d, %d BPP at %d,%d"  %(screenNum, screenW, screenH, screenBPP, screenX, screenY)
    105105
  • trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py

    r52776 r52978  
    22202220        """
    22212221        try:
    2222             iWidth, iHeight, _, _, _ = self.o.console.display.getScreenResolution(iScreenId)
     2222            iWidth, iHeight, _, _, _, _ = self.o.console.display.getScreenResolution(iScreenId)
    22232223            if self.fpApiVer >= 4.4:
    22242224                aPngData = self.o.console.display.takeScreenShotToArray(iScreenId, iWidth, iHeight,
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