VirtualBox

Changeset 98699 in vbox


Ignore:
Timestamp:
Feb 23, 2023 9:43:09 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155999
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking CMachine wrapper usage step-by-step; Rest of 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

    r98691 r98699  
    515515{
    516516    return uisession()->acquireSavedScreenshotInfo(uScreenId, uWidth, uHeight, formats);
     517}
     518
     519bool UIMachine::acquireSavedScreenshot(ulong uScreenId, KBitmapFormat enmFormat,
     520                                       ulong &uWidth, ulong &uHeight, QVector<BYTE> &screenshot)
     521{
     522    return uisession()->acquireSavedScreenshot(uScreenId, enmFormat,
     523                                               uWidth, uHeight, screenshot);
    517524}
    518525
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98691 r98699  
    319319        /** Acquires saved screen-shot info for guest-screen with passed uScreenId. */
    320320        bool acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats);
     321        /** Acquires saved screen-shot for guest-screen with passed uScreenId. */
     322        bool acquireSavedScreenshot(ulong uScreenId, KBitmapFormat enmFormat,
     323                                    ulong &uWidth, ulong &uHeight, QVector<BYTE> &screenshot);
    321324        /** Notifies guest-screen with passed uScreenId about scale-factor change. */
    322325        bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98691 r98699  
    16311631{
    16321632    /* Acquire the screen-data from the saved-state: */
    1633     ULONG uWidth = 0, uHeight = 0;
    1634     const QVector<BYTE> screenData = machine().ReadSavedScreenshotToArray(0, KBitmapFormat_PNG, uWidth, uHeight);
    1635 
    1636     /* Make sure there is saved-state screen-data: */
     1633    ulong uDummy = 0;
     1634    QVector<BYTE> screenData;
     1635    uimachine()->acquireSavedScreenshot(m_uScreenId, KBitmapFormat_PNG, uDummy, uDummy, screenData);
    16371636    if (screenData.isEmpty())
    16381637        return;
     
    16561655
    16571656    /* Dim screen-shot if it is Ok: */
    1658     if (machine().isOk() && !screenShot.isNull())
     1657    if (!screenShot.isNull())
    16591658        dimImage(screenShot);
    16601659
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98691 r98699  
    877877}
    878878
     879bool UISession::acquireSavedScreenshot(ulong uScreenId, KBitmapFormat enmFormat,
     880                                       ulong &uWidth, ulong &uHeight, QVector<BYTE> &screenshot)
     881{
     882    CMachine comMachine = machine();
     883    ULONG uGuestWidth = 0, uGuestHeight = 0;
     884    const QVector<BYTE> guestScreenshot = comMachine.ReadSavedScreenshotToArray(uScreenId, enmFormat,
     885                                                                                uGuestWidth, uGuestHeight);
     886    const bool fSuccess = comMachine.isOk();
     887    if (!fSuccess)
     888        UINotificationMessage::cannotAcquireMachineParameter(comMachine);
     889    else
     890    {
     891        uWidth = uGuestWidth;
     892        uHeight = uGuestHeight;
     893        screenshot = guestScreenshot;
     894    }
     895    return fSuccess;
     896}
     897
    879898bool UISession::notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied)
    880899{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98691 r98699  
    366366        /** Acquires saved screen-shot info for guest-screen with passed uScreenId. */
    367367        bool acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats);
     368        /** Acquires saved screen-shot for guest-screen with passed uScreenId. */
     369        bool acquireSavedScreenshot(ulong uScreenId, KBitmapFormat enmFormat,
     370                                    ulong &uWidth, ulong &uHeight, QVector<BYTE> &screenshot);
    368371        /** Notifies guest-screen with passed uScreenId about scale-factor change. */
    369372        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