VirtualBox

Changeset 98691 in vbox


Ignore:
Timestamp:
Feb 22, 2023 3:05:54 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155991
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking CMachine wrapper usage step-by-step; Stuff related to saved VM info.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98675 r98691  
    480480}
    481481
     482bool UIMachine::acquireSavedGuestScreenInfo(ulong uScreenId,
     483                                            long &xOrigin, long &yOrigin,
     484                                            ulong &uWidth, ulong &uHeight, bool &fEnabled)
     485{
     486    return uisession()->acquireSavedGuestScreenInfo(uScreenId,
     487                                                    xOrigin, yOrigin,
     488                                                    uWidth, uHeight, fEnabled);
     489}
     490
    482491bool UIMachine::setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin,
    483492                                 long xOrigin, long yOrigin, ulong uWidth, ulong uHeight,
     
    501510{
    502511    return uisession()->acquireScreenShot(uScreenId, uWidth, uHeight, enmFormat, pBits);
     512}
     513
     514bool UIMachine::acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats)
     515{
     516    return uisession()->acquireSavedScreenshotInfo(uScreenId, uWidth, uHeight, formats);
    503517}
    504518
     
    13791393        for (int iScreenIndex = 0; iScreenIndex < m_monitorVisibilityVector.size(); ++iScreenIndex)
    13801394        {
    1381             BOOL fEnabled = true;
    1382             ULONG uGuestOriginX = 0, uGuestOriginY = 0, uGuestWidth = 0, uGuestHeight = 0;
    1383             uisession()->machine().QuerySavedGuestScreenInfo(iScreenIndex,
    1384                                                              uGuestOriginX, uGuestOriginY,
    1385                                                              uGuestWidth, uGuestHeight, fEnabled);
     1395            long iDummy = 0;
     1396            ulong uDummy = 0;
     1397            bool fEnabled = true;
     1398            acquireSavedGuestScreenInfo(iScreenIndex, iDummy, iDummy, uDummy, uDummy, fEnabled);
    13861399            m_monitorVisibilityVector[iScreenIndex] = fEnabled;
    13871400        }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98675 r98691  
    303303                                          ulong &uWidth, ulong &uHeight, ulong &uBitsPerPixel,
    304304                                          long &xOrigin, long &yOrigin, KGuestMonitorStatus &enmMonitorStatus);
     305        /** Acquires saved info for guest-screen with passed uScreenId. */
     306        bool acquireSavedGuestScreenInfo(ulong uScreenId,
     307                                         long &xOrigin, long &yOrigin,
     308                                         ulong &uWidth, ulong &uHeight, bool &fEnabled);
    305309        /** Defines video mode hint for guest-screen with passed uScreenId. */
    306310        bool setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin,
     
    313317        /** Acquires screen-shot for guest-screen with passed uScreenId. */
    314318        bool acquireScreenShot(ulong uScreenId, ulong uWidth, ulong uHeight, KBitmapFormat enmFormat, uchar *pBits);
     319        /** Acquires saved screen-shot info for guest-screen with passed uScreenId. */
     320        bool acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats);
    315321        /** Notifies guest-screen with passed uScreenId about scale-factor change. */
    316322        bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98688 r98691  
    12831283        if (enmActualState == KMachineState_Saved || enmActualState == KMachineState_AbortedSaved)
    12841284        {
    1285             ULONG uWidth = 0, uHeight = 0;
    1286             QVector<KBitmapFormat> formats = machine().QuerySavedScreenshotInfo(0, uWidth, uHeight);
     1285            ulong uWidth = 0, uHeight = 0;
     1286            QVector<KBitmapFormat> formats;
     1287            uimachine()->acquireSavedScreenshotInfo(m_uScreenId, uWidth, uHeight, formats);
    12871288            if (formats.size() > 0)
    12881289            {
     
    12901291                size = QSize(uWidth, uHeight);
    12911292                /* Try to get the real guest dimensions from the save-state: */
    1292                 ULONG uGuestOriginX = 0, uGuestOriginY = 0, uGuestWidth = 0, uGuestHeight = 0;
    1293                 BOOL fEnabled = true;
    1294                 machine().QuerySavedGuestScreenInfo(m_uScreenId, uGuestOriginX, uGuestOriginY, uGuestWidth, uGuestHeight, fEnabled);
     1293                long iDummy = 0;
     1294                ulong uGuestWidth = 0, uGuestHeight = 0;
     1295                bool fDummy = true;
     1296                uimachine()->acquireSavedGuestScreenInfo(m_uScreenId,
     1297                                                         iDummy, iDummy,
     1298                                                         uGuestWidth, uGuestHeight, fDummy);
    12951299                if (uGuestWidth  > 0 && uGuestHeight > 0)
    12961300                    size = QSize(uGuestWidth, uGuestHeight);
     
    16351639
    16361640    /* Acquire the screen-data properties from the saved-state: */
    1637     ULONG uGuestOriginX = 0, uGuestOriginY = 0, uGuestWidth = 0, uGuestHeight = 0;
    1638     BOOL fEnabled = true;
    1639     machine().QuerySavedGuestScreenInfo(m_uScreenId, uGuestOriginX, uGuestOriginY, uGuestWidth, uGuestHeight, fEnabled);
     1641    long iDummy = 0;
     1642    ulong uGuestWidth = 0, uGuestHeight = 0;
     1643    bool fDummy = true;
     1644    uimachine()->acquireSavedGuestScreenInfo(m_uScreenId, iDummy, iDummy, uGuestWidth, uGuestHeight, fDummy);
    16401645
    16411646    /* Calculate effective size: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98686 r98691  
    768768}
    769769
     770bool UISession::acquireSavedGuestScreenInfo(ulong uScreenId,
     771                                            long &xOrigin, long &yOrigin,
     772                                            ulong &uWidth, ulong &uHeight, bool &fEnabled)
     773{
     774    CMachine comMachine = machine();
     775    ULONG uGuestXOrigin = 0, uGuestYOrigin = 0, uGuestWidth = 0, uGuestHeight = 0;
     776    BOOL fGuestEnabled = FALSE;
     777    comMachine.QuerySavedGuestScreenInfo(uScreenId, uGuestXOrigin, uGuestYOrigin, uGuestWidth, uGuestHeight, fGuestEnabled);
     778    const bool fSuccess = comMachine.isOk();
     779    if (!fSuccess)
     780        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     781    else
     782    {
     783        xOrigin = uGuestXOrigin;
     784        yOrigin = uGuestYOrigin;
     785        uWidth = uGuestWidth;
     786        uHeight = uGuestHeight;
     787        fEnabled = fGuestEnabled == TRUE;
     788    }
     789    return fSuccess;
     790}
     791
    770792bool UISession::setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin, long xOrigin, long yOrigin,
    771793                                 ulong uWidth, ulong uHeight, ulong uBitsPerPixel, bool fNotify)
     
    834856        if (!fSuccess)
    835857            UINotificationMessage::cannotAcquireDisplayParameter(comDisplay);
     858    }
     859    return fSuccess;
     860}
     861
     862bool UISession::acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats)
     863{
     864    CMachine comMachine = machine();
     865    ULONG uGuestWidth = 0, uGuestHeight = 0;
     866    QVector<KBitmapFormat> guestFormats = comMachine.QuerySavedScreenshotInfo(uScreenId, uGuestWidth, uGuestHeight);
     867    const bool fSuccess = comMachine.isOk();
     868    if (!fSuccess)
     869        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     870    else
     871    {
     872        uWidth = uGuestWidth;
     873        uHeight = uGuestHeight;
     874        formats = guestFormats;
    836875    }
    837876    return fSuccess;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98675 r98691  
    350350                                          ulong &uWidth, ulong &uHeight, ulong &uBitsPerPixel,
    351351                                          long &xOrigin, long &yOrigin, KGuestMonitorStatus &enmMonitorStatus);
     352        /** Acquires saved info for guest-screen with passed uScreenId. */
     353        bool acquireSavedGuestScreenInfo(ulong uScreenId,
     354                                         long &xOrigin, long &yOrigin,
     355                                         ulong &uWidth, ulong &uHeight, bool &fEnabled);
    352356        /** Defines video mode hint for guest-screen with passed uScreenId. */
    353357        bool setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin,
     
    360364        /** Acquires screen-shot for guest-screen with passed uScreenId. */
    361365        bool acquireScreenShot(ulong uScreenId, ulong uWidth, ulong uHeight, KBitmapFormat enmFormat, uchar *pBits);
     366        /** Acquires saved screen-shot info for guest-screen with passed uScreenId. */
     367        bool acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats);
    362368        /** Notifies guest-screen with passed uScreenId about scale-factor change. */
    363369        bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied);
Note: See TracChangeset for help on using the changeset viewer.

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