VirtualBox

Changeset 81964 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 18, 2019 8:42:02 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134761
Message:

Main/GraphicsAdapter: Split off a few attributes from Machine interface, which affects quite a few other interfaces.
Frontends/VirtualBox+VBoxManage+VBoxSDL+VBoxShell: Adapt accordingly.

Location:
trunk/src/VBox/Frontends
Files:
25 edited

Legend:

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

    r81962 r81964  
    19121912            CHECK_ERROR_BREAK(recordingSettings, COMGETTER(Screens)(ComSafeArrayAsOutParam(saRecordingScreenScreens)));
    19131913
     1914            ComPtr<IGraphicsAdapter> pGraphicsAdapter;
     1915            CHECK_ERROR_BREAK(sessionMachine, COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam()));
     1916
    19141917            /* Note: For now all screens have the same configuration. */
    19151918
     
    19291932            {
    19301933                ULONG cMonitors = 64;
    1931                 CHECK_ERROR_BREAK(sessionMachine, COMGETTER(MonitorCount)(&cMonitors));
     1934                CHECK_ERROR_BREAK(pGraphicsAdapter, COMGETTER(MonitorCount)(&cMonitors));
    19321935                com::SafeArray<BOOL> saScreens(cMonitors);
    19331936                if (   a->argc == 4
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r81603 r81964  
    723723    SHOW_ULONG_PROP(       machine, MemorySize,                 "memory",               "Memory size",      "MB");
    724724    SHOW_BOOLEAN_PROP(     machine, PageFusionEnabled,          "pagefusion",           "Page Fusion:");
    725     SHOW_ULONG_PROP(       machine, VRAMSize,                   "vram",                 "VRAM size:",        "MB");
     725    ComPtr<IGraphicsAdapter> pGraphicsAdapter;
     726    machine->COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam());
     727    SHOW_ULONG_PROP(pGraphicsAdapter, VRAMSize,                 "vram",                 "VRAM size:",        "MB");
    726728    SHOW_ULONG_PROP(       machine, CPUExecutionCap,            "cpuexecutioncap",      "CPU exec cap:",     "%");
    727729    SHOW_BOOLEAN_PROP(     machine, HPETEnabled,                "hpet",                 "HPET:");
     
    920922
    921923    GraphicsControllerType_T enmGraphics;
    922     rc = machine->COMGETTER(GraphicsControllerType)(&enmGraphics);
     924    rc = pGraphicsAdapter->COMGETTER(GraphicsControllerType)(&enmGraphics);
    923925    if (SUCCEEDED(rc))
    924926    {
     
    962964    }
    963965
    964     SHOW_ULONG_PROP(      machine,  MonitorCount,               "monitorcount",             "Monitor count:", "");
    965     SHOW_BOOLEAN_PROP(    machine,  Accelerate3DEnabled,        "accelerate3d",             "3D Acceleration:");
     966    SHOW_ULONG_PROP(pGraphicsAdapter, MonitorCount,             "monitorcount",             "Monitor count:", "");
     967    SHOW_BOOLEAN_PROP(pGraphicsAdapter, Accelerate3DEnabled,    "accelerate3d",             "3D Acceleration:");
    966968#ifdef VBOX_WITH_VIDEOHWACCEL
    967     SHOW_BOOLEAN_PROP(    machine,  Accelerate2DVideoEnabled,   "accelerate2dvideo",        "2D Video Acceleration:");
     969    SHOW_BOOLEAN_PROP(pGraphicsAdapter, Accelerate2DVideoEnabled, "accelerate2dvideo",      "2D Video Acceleration:");
    968970#endif
    969971    SHOW_BOOLEAN_PROP(    machine,  TeleporterEnabled,          "teleporterenabled",        "Teleporter Enabled:");
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r81603 r81964  
    558558    sessionMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());
    559559
     560    ComPtr<IGraphicsAdapter> pGraphicsAdapter;
     561    sessionMachine->COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam());
     562
    560563    RTGETOPTSTATE GetOptState;
    561564    RTGetOptInit(&GetOptState, a->argc, a->argv, g_aModifyVMOptions,
     
    642645            case MODIFYVM_VRAM:
    643646            {
    644                 CHECK_ERROR(sessionMachine, COMSETTER(VRAMSize)(ValueUnion.u32));
     647                CHECK_ERROR(pGraphicsAdapter, COMSETTER(VRAMSize)(ValueUnion.u32));
    645648                break;
    646649            }
     
    892895                if (   !RTStrICmp(ValueUnion.psz, "none")
    893896                    || !RTStrICmp(ValueUnion.psz, "disabled"))
    894                     CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_Null));
     897                    CHECK_ERROR(pGraphicsAdapter, COMSETTER(GraphicsControllerType)(GraphicsControllerType_Null));
    895898                else if (   !RTStrICmp(ValueUnion.psz, "vboxvga")
    896899                         || !RTStrICmp(ValueUnion.psz, "vbox")
    897900                         || !RTStrICmp(ValueUnion.psz, "vga")
    898901                         || !RTStrICmp(ValueUnion.psz, "vesa"))
    899                     CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxVGA));
     902                    CHECK_ERROR(pGraphicsAdapter, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxVGA));
    900903#ifdef VBOX_WITH_VMSVGA
    901904                else if (   !RTStrICmp(ValueUnion.psz, "vmsvga")
    902905                         || !RTStrICmp(ValueUnion.psz, "vmware"))
    903                     CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VMSVGA));
     906                    CHECK_ERROR(pGraphicsAdapter, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VMSVGA));
    904907                else if (   !RTStrICmp(ValueUnion.psz, "vboxsvga")
    905908                         || !RTStrICmp(ValueUnion.psz, "svga"))
    906                     CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxSVGA));
     909                    CHECK_ERROR(pGraphicsAdapter, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxSVGA));
    907910#endif
    908911                else
     
    916919            case MODIFYVM_MONITORCOUNT:
    917920            {
    918                 CHECK_ERROR(sessionMachine, COMSETTER(MonitorCount)(ValueUnion.u32));
     921                CHECK_ERROR(pGraphicsAdapter, COMSETTER(MonitorCount)(ValueUnion.u32));
    919922                break;
    920923            }
     
    922925            case MODIFYVM_ACCELERATE3D:
    923926            {
    924                 CHECK_ERROR(sessionMachine, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));
     927                CHECK_ERROR(pGraphicsAdapter, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));
    925928                break;
    926929            }
     
    929932            case MODIFYVM_ACCELERATE2DVIDEO:
    930933            {
    931                 CHECK_ERROR(sessionMachine, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));
     934                CHECK_ERROR(pGraphicsAdapter, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));
    932935                break;
    933936            }
     
    30063009                    {
    30073010                        ULONG cMonitors = 64;
    3008                         CHECK_ERROR(sessionMachine, COMGETTER(MonitorCount)(&cMonitors));
     3011                        CHECK_ERROR(pGraphicsAdapter, COMGETTER(MonitorCount)(&cMonitors));
    30093012                        com::SafeArray<BOOL> screens(cMonitors);
    30103013                        if (parseScreens(ValueUnion.psz, &screens))
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r81537 r81964  
    14571457
    14581458    ComPtr<IMachine> pMachine;
     1459    ComPtr<IGraphicsAdapter> pGraphicsAdapter;
    14591460
    14601461    rc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient);
     
    19501951    }
    19511952
     1953    rc = gpMachine->COMGETTER(GraphicsAdapter)(pGraphicsAdapter.asOutParam());
     1954    if (rc != S_OK)
     1955    {
     1956        RTPrintf("Error: could not get graphics adapter object\n");
     1957        goto leave;
     1958    }
     1959
    19521960    if (vramSize)
    19531961    {
    1954         rc = gpMachine->COMSETTER(VRAMSize)(vramSize);
     1962        rc = pGraphicsAdapter->COMSETTER(VRAMSize)(vramSize);
    19551963        if (rc != S_OK)
    19561964        {
    1957             gpMachine->COMGETTER(VRAMSize)((ULONG*)&vramSize);
     1965            pGraphicsAdapter->COMGETTER(VRAMSize)((ULONG*)&vramSize);
    19581966            RTPrintf("Error: could not set VRAM size, using current setting of %d MBytes\n", vramSize);
    19591967        }
     
    19761984        goto leave;
    19771985
    1978     gpMachine->COMGETTER(MonitorCount)(&gcMonitors);
     1986    pGraphicsAdapter->COMGETTER(MonitorCount)(&gcMonitors);
    19791987    if (gcMonitors > 64)
    19801988        gcMonitors = 64;
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r81603 r81964  
    976976    print("  CPUs [CPUCount]: %d" % (mach.CPUCount))
    977977    print("  RAM [memorySize]: %dM" % (mach.memorySize))
    978     print("  VRAM [VRAMSize]: %dM" % (mach.VRAMSize))
    979     print("  Monitors [monitorCount]: %d" % (mach.monitorCount))
     978    print("  VRAM [VRAMSize]: %dM" % (mach.graphicsAdapter.VRAMSize))
     979    print("  Monitors [monitorCount]: %d" % (mach.graphicsAdapter.monitorCount))
    980980    print("  Chipset [chipsetType]: %s (%s)" % (asEnumElem(ctx, "ChipsetType", mach.chipsetType), mach.chipsetType))
    981981    print()
     
    996996    print("  Nested paging [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_NestedPaging, value)]: " + asState(hwVirtNestedPaging))
    997997
    998     print("  Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.accelerate3DEnabled))
    999     print("  Hardware 2d video acceleration [accelerate2DVideoEnabled]: " + asState(mach.accelerate2DVideoEnabled))
     998    print("  Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.graphicsAdapter.accelerate3DEnabled))
     999    print("  Hardware 2d video acceleration [accelerate2DVideoEnabled]: " + asState(mach.graphicsAdapter.accelerate2DVideoEnabled))
    10001000
    10011001    print("  Use universal time [RTCUseUTC]: %s" % (asState(mach.RTCUseUTC)))
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r80215 r81964  
    3030#include "COMEnums.h"
    3131#include "CAudioAdapter.h"
     32#include "CGraphicsAdapter.h"
    3233#include "CMachine.h"
    3334#include "CMediumAttachment.h"
     
    260261    }
    261262
     263    const CGraphicsAdapter comGraphics = comMachine.GetGraphicsAdapter();
     264
    262265    /* Video memory: */
    263266    if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM)
     
    265268        /* Configure hovering anchor: */
    266269        const QString strAnchorType = QString("video_memory");
    267         const int iVideoMemory = comMachine.GetVRAMSize();
     270        const int iVideoMemory = comGraphics.GetVRAMSize();
    268271        table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"),
    269272                                 QString("<a href=#%1,%2>%3</a>")
     
    276279    if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount)
    277280    {
    278         const int cGuestScreens = comMachine.GetMonitorCount();
     281        const int cGuestScreens = comGraphics.GetMonitorCount();
    279282        if (cGuestScreens > 1)
    280283            table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"),
     
    304307    {
    305308        const QString strAnchorType = QString("graphics_controller_type");
    306         const KGraphicsControllerType enmType = comMachine.GetGraphicsControllerType();
     309        const KGraphicsControllerType enmType = comGraphics.GetGraphicsControllerType();
    307310        table << UITextTableLine(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"),
    308311                                 QString("<a href=#%1,%2>%3</a>")
     
    318321#ifdef VBOX_WITH_VIDEOHWACCEL
    319322        /* 2D acceleration: */
    320         if (comMachine.GetAccelerate2DVideoEnabled())
     323        if (comGraphics.GetAccelerate2DVideoEnabled())
    321324            acceleration << QApplication::translate("UIDetails", "2D Video", "details (display)");
    322325#endif
    323326        /* 3D acceleration: */
    324         if (comMachine.GetAccelerate3DEnabled())
     327        if (comGraphics.GetAccelerate3DEnabled())
    325328            acceleration << QApplication::translate("UIDetails", "3D", "details (display)");
    326329        if (!acceleration.isEmpty())
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMachineAttributeSetter.cpp

    r81422 r81964  
    2727/* COM includes: */
    2828#include "CAudioAdapter.h"
     29#include "CGraphicsAdapter.h"
    2930#include "CNetworkAdapter.h"
    3031#include "CUSBController.h"
     
    159160            {
    160161                /* Change machine video memory (VRAM): */
    161                 comMachine.SetVRAMSize(guiAttribute.toInt());
     162                comMachine.GetGraphicsAdapter().SetVRAMSize(guiAttribute.toInt());
    162163                if (!comMachine.isOk())
    163164                {
     
    170171            {
    171172                /* Change machine graphics controller type: */
    172                 comMachine.SetGraphicsControllerType(guiAttribute.value<KGraphicsControllerType>());
     173                comMachine.GetGraphicsAdapter().SetGraphicsControllerType(guiAttribute.value<KGraphicsControllerType>());
    173174                if (!comMachine.isOk())
    174175                {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r80831 r81964  
    3939/* COM includes: */
    4040#include "CAudioAdapter.h"
     41#include "CGraphicsAdapter.h"
    4142#include "CRecordingSettings.h"
    4243#include "CRecordingScreenSettings.h"
     
    742743        QString strFullData;
    743744
     745        CGraphicsAdapter comGraphics = machine.GetGraphicsAdapter();
    744746        /* Video Memory: */
    745         const ULONG uVRAMSize = machine.GetVRAMSize();
     747        const ULONG uVRAMSize = comGraphics.GetVRAMSize();
    746748        const QString strVRAMSize = UICommon::tr("<nobr>%1 MB</nobr>", "details report").arg(uVRAMSize);
    747749        strFullData += s_strTableRow2
     
    749751
    750752        /* Monitor Count: */
    751         const ULONG uMonitorCount = machine.GetMonitorCount();
     753        const ULONG uMonitorCount = comGraphics.GetMonitorCount();
    752754        if (uMonitorCount > 1)
    753755        {
     
    758760
    759761        /* 3D acceleration: */
    760         const bool fAcceleration3D = machine.GetAccelerate3DEnabled() && uiCommon().is3DAvailable();
     762        const bool fAcceleration3D = comGraphics.GetAccelerate3DEnabled() && uiCommon().is3DAvailable();
    761763        if (fAcceleration3D)
    762764        {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r80652 r81964  
    6868/* COM includes: */
    6969#include "CKeyboard.h"
     70#include "CGraphicsAdapter.h"
    7071
    7172/* Other VBox includes: */
     
    10141015    ::memset(m_pressedKeys, 0, sizeof(m_pressedKeys));
    10151016
    1016     m_cMonitors = uisession()->machine().GetMonitorCount();
     1017    m_cMonitors = uisession()->machine().GetGraphicsAdapter().GetMonitorCount();
    10171018}
    10181019
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r81328 r81964  
    7272/* COM includes: */
    7373#include "CAudioAdapter.h"
     74#include "CGraphicsAdapter.h"
    7475#include "CRecordingSettings.h"
    7576#include "CVirtualBoxErrorInfo.h"
     
    18401841    /* TODO_NEW_CORE: On reset the additional screens didn't get a display
    18411842       update. Emulate this for now until it get fixed. */
    1842     ulong uMonitorCount = machine().GetMonitorCount();
     1843    ulong uMonitorCount = machine().GetGraphicsAdapter().GetMonitorCount();
    18431844    for (ulong uScreenId = 1; uScreenId < uMonitorCount; ++uScreenId)
    18441845        machineWindows().at(uScreenId)->update();
     
    31213122{
    31223123    /* Get console: */
    3123     const int cGuestScreens = machine().GetMonitorCount();
     3124    const int cGuestScreens = machine().GetGraphicsAdapter().GetMonitorCount();
    31243125    QList<QImage> images;
    31253126    ULONG uMaxWidth  = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r80652 r81964  
    5555#include "CConsole.h"
    5656#include "CDisplay.h"
     57#include "CGraphicsAdapter.h"
    5758#include "CSession.h"
    5859#include "CFramebuffer.h"
     
    243244
    244245    /* Propagate the scale-factor related attributes to 3D service if necessary: */
    245     if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     246    if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    246247    {
    247248        double dScaleFactorFor3D = dScaleFactor;
     
    426427    if (   !isFullscreenOrSeamless()
    427428        && uisession()->isGuestSupportsGraphics()
    428         && (machine().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA))
     429        && (machine().GetGraphicsAdapter().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA))
    429430        storeGuestSizeHint(QSize(iWidth, iHeight));
    430431
     
    519520
    520521    /* Propagate the scale-factor related attributes to 3D service if necessary: */
    521     if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     522    if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    522523    {
    523524        double dScaleFactorFor3D = dScaleFactor;
     
    715716
    716717        /* Propagate the scale-factor related attributes to 3D service if necessary: */
    717         if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     718        if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    718719        {
    719720            double dScaleFactorFor3D = dScaleFactor;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r80617 r81964  
    4444/* COM includes: */
    4545#include "CConsole.h"
     46#include "CGraphicsAdapter.h"
    4647#include "CSnapshot.h"
    4748
     
    495496#ifdef VBOX_WITH_VIDEOHWACCEL
    496497    /* Need to force the QGL framebuffer in case 2D Video Acceleration is supported & enabled: */
    497     bool bAccelerate2DVideo = machine().GetAccelerate2DVideoEnabled() && VBox2DHelpers::isAcceleration2DVideoAvailable();
     498    bool bAccelerate2DVideo = machine().GetGraphicsAdapter().GetAccelerate2DVideoEnabled() && VBox2DHelpers::isAcceleration2DVideoAvailable();
    498499#endif /* VBOX_WITH_VIDEOHWACCEL */
    499500
     
    573574        strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName);
    574575#endif /* !VBOX_WS_MAC */
    575         if (machine().GetMonitorCount() > 1)
     576        if (machine().GetGraphicsAdapter().GetMonitorCount() > 1)
    576577            strMachineName += QString(" : %1").arg(m_uScreenId + 1);
    577578        setWindowTitle(strMachineName);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r79365 r81964  
    3838#include "CMachine.h"
    3939#include "CDisplay.h"
     40#include "CGraphicsAdapter.h"
    4041
    4142
    4243UIMultiScreenLayout::UIMultiScreenLayout(UIMachineLogic *pMachineLogic)
    4344    : m_pMachineLogic(pMachineLogic)
    44     , m_cGuestScreens(m_pMachineLogic->machine().GetMonitorCount())
     45    , m_cGuestScreens(m_pMachineLogic->machine().GetGraphicsAdapter().GetMonitorCount())
    4546    , m_cHostScreens(0)
    4647{
     
    227228    if (m_pMachineLogic->uisession()->isGuestSupportsGraphics())
    228229    {
    229         quint64 availBits = m_pMachineLogic->machine().GetVRAMSize() * _1M * 8;
     230        quint64 availBits = m_pMachineLogic->machine().GetGraphicsAdapter().GetVRAMSize() * _1M * 8;
    230231        quint64 usedBits = memoryRequirements(tmpMap);
    231232        fSuccess = availBits >= usedBits;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r81826 r81964  
    6363/* COM includes: */
    6464#include "CAudioAdapter.h"
     65#include "CGraphicsAdapter.h"
    6566#include "CRecordingSettings.h"
    6667#include "CSystemProperties.h"
     
    246247    /* Log whether 2D video acceleration is enabled: */
    247248    LogRel(("GUI: 2D video acceleration is %s\n",
    248            machine().GetAccelerate2DVideoEnabled() && VBox2DHelpers::isAcceleration2DVideoAvailable()
     249           machine().GetGraphicsAdapter().GetAccelerate2DVideoEnabled() && VBox2DHelpers::isAcceleration2DVideoAvailable()
    249250           ? "enabled" : "disabled"));
    250251#endif /* VBOX_WITH_VIDEOHWACCEL */
     
    12241225
    12251226    /* Prepare initial screen visibility status: */
    1226     m_monitorVisibilityVector.resize(machine().GetMonitorCount());
     1227    m_monitorVisibilityVector.resize(machine().GetGraphicsAdapter().GetMonitorCount());
    12271228    m_monitorVisibilityVector.fill(false);
    12281229    m_monitorVisibilityVector[0] = true;
    12291230
    12301231    /* Prepare empty last full-screen size vector: */
    1231     m_monitorLastFullScreenSizeVector.resize(machine().GetMonitorCount());
     1232    m_monitorLastFullScreenSizeVector.resize(machine().GetGraphicsAdapter().GetMonitorCount());
    12321233    m_monitorLastFullScreenSizeVector.fill(QSize(-1, -1));
    12331234
     
    12691270
    12701271    /* Prepare initial screen visibility status of host-desires (same as facts): */
    1271     m_monitorVisibilityVectorHostDesires.resize(machine().GetMonitorCount());
     1272    m_monitorVisibilityVectorHostDesires.resize(machine().GetGraphicsAdapter().GetMonitorCount());
    12721273    for (int iScreenIndex = 0; iScreenIndex < m_monitorVisibilityVector.size(); ++iScreenIndex)
    12731274        m_monitorVisibilityVectorHostDesires[iScreenIndex] = m_monitorVisibilityVector[iScreenIndex];
     
    12811282{
    12821283    /* Each framebuffer will be really prepared on first UIMachineView creation: */
    1283     m_frameBufferVector.resize(machine().GetMonitorCount());
     1284    m_frameBufferVector.resize(machine().GetGraphicsAdapter().GetMonitorCount());
    12841285
    12851286    /* Make sure action-pool knows guest-screen count: */
     
    21952196    /* Remember 'desired' visibility status: */
    21962197    /* See note in UIMachineView::sltHandleNotifyChange() regarding the graphics controller check. */
    2197     if (machine().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA)
     2198    if (machine().GetGraphicsAdapter().GetGraphicsControllerType() != KGraphicsControllerType_VMSVGA)
    21982199        gEDataManager->setLastGuestScreenVisibilityStatus(uScreenId, fIsMonitorVisible, uiCommon().managedVMUuid());
    21992200
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r80818 r81964  
    3939#endif /* VBOX_WS_MAC */
    4040
     41/* COM includes: */
     42#include "CGraphicsAdapter.h"
     43
    4144
    4245UIMachineLogicFullscreen::UIMachineLogicFullscreen(QObject *pParent, UISession *pSession)
     
    6265    if (uisession()->isGuestSupportsGraphics())
    6366    {
    64         quint64 availBits = machine().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
     67        quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
    6568        quint64 usedBits = m_pScreenLayout->memoryRequirements();
    6669        if (availBits < usedBits)
     
    527530
    528531    /* Create machine-window(s): */
    529     for (uint cScreenId = 0; cScreenId < machine().GetMonitorCount(); ++cScreenId)
     532    for (uint cScreenId = 0; cScreenId < machine().GetGraphicsAdapter().GetMonitorCount(); ++cScreenId)
    530533        addMachineWindow(UIMachineWindow::create(this, cScreenId));
    531534
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r81510 r81964  
    3131
    3232/* COM includes: */
     33#include "CGraphicsAdapter.h"
    3334#include "CGuest.h"
    3435#include "CVRDEServerInfo.h"
     
    251252void UIRuntimeInfoWidget::updateScreenInfo(int iScreenID /* = -1 */)
    252253{
    253     ULONG uGuestScreens = m_machine.GetMonitorCount();
     254    ULONG uGuestScreens = m_machine.GetGraphicsAdapter().GetMonitorCount();
    254255    m_screenResolutions.resize(uGuestScreens);
    255256    if (iScreenID != -1 && iScreenID >= (int)uGuestScreens)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r80881 r81964  
    4242#include "CConsole.h"
    4343#include "CDisplay.h"
     44#include "CGraphicsAdapter.h"
    4445
    4546
     
    319320
    320321    /* Get monitors count: */
    321     ulong uMonitorCount = machine().GetMonitorCount();
     322    ulong uMonitorCount = machine().GetGraphicsAdapter().GetMonitorCount();
    322323    /* Create machine window(s): */
    323324    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r80652 r81964  
    3636#endif
    3737
     38/* GUI includes: */
     39#include "CGraphicsAdapter.h"
     40
    3841
    3942UIMachineLogicScale::UIMachineLogicScale(QObject *pParent, UISession *pSession)
     
    138141
    139142    /* Get monitors count: */
    140     ulong uMonitorCount = machine().GetMonitorCount();
     143    ulong uMonitorCount = machine().GetGraphicsAdapter().GetMonitorCount();
    141144    /* Create machine window(s): */
    142145    for (ulong uScreenId = 0; uScreenId < uMonitorCount; ++ uScreenId)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r79365 r81964  
    3333#include "CConsole.h"
    3434#include "CDisplay.h"
     35#include "CGraphicsAdapter.h"
    3536
    3637/* Other VBox includes: */
     
    7172    {
    7273        /* Propagate scale-factor to 3D service if necessary: */
    73         if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     74        if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    7475        {
    7576            double xScaleFactor = (double)scaledSize.width()  / frameBuffer()->width();
     
    130131    {
    131132        /* Propagate scale-factor to 3D service if necessary: */
    132         if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     133        if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    133134        {
    134135            double xScaleFactor = (double)scaledSize.width()  / frameBuffer()->width();
     
    153154    frameBuffer()->setUseUnscaledHiDPIOutput(fUseUnscaledHiDPIOutput);
    154155    /* Propagate unscaled-hidpi-output feature to 3D service if necessary: */
    155     if (machine().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     156    if (machine().GetGraphicsAdapter().GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    156157        display().NotifyHiDPIOutputPolicyChange(fUseUnscaledHiDPIOutput);
    157158
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r80652 r81964  
    3737#endif /* VBOX_WS_MAC */
    3838
     39/* GUI includes: */
     40#include "CGraphicsAdapter.h"
     41
    3942
    4043UIMachineLogicSeamless::UIMachineLogicSeamless(QObject *pParent, UISession *pSession)
     
    5962    if (uisession()->isGuestSupportsSeamless())
    6063    {
    61         quint64 availBits = machine().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
     64        quint64 availBits = machine().GetGraphicsAdapter().GetVRAMSize() /* VRAM */ * _1M /* MiB to bytes */ * 8 /* to bits */;
    6265        quint64 usedBits = m_pScreenLayout->memoryRequirements();
    6366        if (availBits < usedBits)
     
    268271
    269272    /* Create machine-window(s): */
    270     for (uint cScreenId = 0; cScreenId < machine().GetMonitorCount(); ++cScreenId)
     273    for (uint cScreenId = 0; cScreenId < machine().GetGraphicsAdapter().GetMonitorCount(); ++cScreenId)
    271274        addMachineWindow(UIMachineWindow::create(this, cScreenId));
    272275
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r81457 r81964  
    5252
    5353/* COM includes: */
     54#include "CGraphicsAdapter.h"
    5455#include "CUSBController.h"
    5556
     
    469470        {
    470471            if (pDisplayPage && pDisplayPage->isAcceleration2DVideoSelected())
    471                 m_machine.SetAccelerate2DVideoEnabled(false);
     472                m_machine.GetGraphicsAdapter().SetAccelerate2DVideoEnabled(false);
    472473        }
    473474#endif /* VBOX_WITH_VIDEOHWACCEL */
     
    478479            && pDisplayPage->isAcceleration3DSelected()
    479480            && pDisplayPage->graphicsControllerTypeCurrent() != pDisplayPage->graphicsControllerTypeRecommended())
    480             m_machine.SetGraphicsControllerType(pDisplayPage->graphicsControllerTypeRecommended());
     481            m_machine.GetGraphicsAdapter().SetGraphicsControllerType(pDisplayPage->graphicsControllerTypeRecommended());
    481482#endif /* VBOX_WITH_3D_ACCELERATION */
    482483
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r81457 r81964  
    2727
    2828/* COM includes: */
     29#include "CGraphicsAdapter.h"
    2930#include "CRecordingSettings.h"
    3031#include "CRecordingScreenSettings.h"
     
    371372
    372373    /* Gather old 'Screen' data: */
    373     oldDisplayData.m_iCurrentVRAM = m_machine.GetVRAMSize();
    374     oldDisplayData.m_cGuestScreenCount = m_machine.GetMonitorCount();
     374    const CGraphicsAdapter &comGraphics = m_machine.GetGraphicsAdapter();
     375    oldDisplayData.m_iCurrentVRAM = comGraphics.GetVRAMSize();
     376    oldDisplayData.m_cGuestScreenCount = comGraphics.GetMonitorCount();
    375377    oldDisplayData.m_scaleFactors = gEDataManager->scaleFactors(m_machine.GetId());
    376     oldDisplayData.m_graphicsControllerType = m_machine.GetGraphicsControllerType();
     378    oldDisplayData.m_graphicsControllerType = comGraphics.GetGraphicsControllerType();
    377379#ifdef VBOX_WITH_3D_ACCELERATION
    378     oldDisplayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled();
     380    oldDisplayData.m_f3dAccelerationEnabled = comGraphics.GetAccelerate3DEnabled();
    379381#endif
    380382#ifdef VBOX_WITH_VIDEOHWACCEL
    381     oldDisplayData.m_f2dVideoAccelerationEnabled = m_machine.GetAccelerate2DVideoEnabled();
     383    oldDisplayData.m_f2dVideoAccelerationEnabled = comGraphics.GetAccelerate2DVideoEnabled();
    382384#endif
    383385    /* Check whether remote display server is valid: */
     
    13731375    if (fSuccess)
    13741376    {
     1377        CGraphicsAdapter comGraphics = m_machine.GetGraphicsAdapter();
    13751378        /* Get old display data from the cache: */
    13761379        const UIDataSettingsMachineDisplay &oldDisplayData = m_pCache->base();
     
    13811384        if (fSuccess && isMachineOffline() && newDisplayData.m_iCurrentVRAM != oldDisplayData.m_iCurrentVRAM)
    13821385        {
    1383             m_machine.SetVRAMSize(newDisplayData.m_iCurrentVRAM);
    1384             fSuccess = m_machine.isOk();
     1386            comGraphics.SetVRAMSize(newDisplayData.m_iCurrentVRAM);
     1387            fSuccess = comGraphics.isOk();
    13851388        }
    13861389        /* Save guest screen count: */
    13871390        if (fSuccess && isMachineOffline() && newDisplayData.m_cGuestScreenCount != oldDisplayData.m_cGuestScreenCount)
    13881391        {
    1389             m_machine.SetMonitorCount(newDisplayData.m_cGuestScreenCount);
    1390             fSuccess = m_machine.isOk();
     1392            comGraphics.SetMonitorCount(newDisplayData.m_cGuestScreenCount);
     1393            fSuccess = comGraphics.isOk();
    13911394        }
    13921395        /* Save the Graphics Controller Type: */
    13931396        if (fSuccess && isMachineOffline() && newDisplayData.m_graphicsControllerType != oldDisplayData.m_graphicsControllerType)
    13941397        {
    1395             m_machine.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType);
    1396             fSuccess = m_machine.isOk();
     1398            comGraphics.SetGraphicsControllerType(newDisplayData.m_graphicsControllerType);
     1399            fSuccess = comGraphics.isOk();
    13971400        }
    13981401#ifdef VBOX_WITH_3D_ACCELERATION
     
    14001403        if (fSuccess && isMachineOffline() && newDisplayData.m_f3dAccelerationEnabled != oldDisplayData.m_f3dAccelerationEnabled)
    14011404        {
    1402             m_machine.SetAccelerate3DEnabled(newDisplayData.m_f3dAccelerationEnabled);
    1403             fSuccess = m_machine.isOk();
     1405            comGraphics.SetAccelerate3DEnabled(newDisplayData.m_f3dAccelerationEnabled);
     1406            fSuccess = comGraphics.isOk();
    14041407        }
    14051408#endif
     
    14081411        if (fSuccess && isMachineOffline() && newDisplayData.m_f2dVideoAccelerationEnabled != oldDisplayData.m_f2dVideoAccelerationEnabled)
    14091412        {
    1410             m_machine.SetAccelerate2DVideoEnabled(newDisplayData.m_f2dVideoAccelerationEnabled);
    1411             fSuccess = m_machine.isOk();
     1413            comGraphics.SetAccelerate2DVideoEnabled(newDisplayData.m_f2dVideoAccelerationEnabled);
     1414            fSuccess = comGraphics.isOk();
    14121415        }
    14131416#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp

    r79365 r81964  
    4444/* COM includes: */
    4545#include "CAudioAdapter.h"
     46#include "CGraphicsAdapter.h"
    4647#include "CRecordingSettings.h"
    4748#include "CRecordingScreenSettings.h"
     
    13111312        case DetailsElementType_Display:
    13121313        {
     1314            const CGraphicsAdapter &comGraphics = comMachine.GetGraphicsAdapter();
     1315            const CGraphicsAdapter &comGraphicsOld = comMachineOld.GetGraphicsAdapter();
    13131316            /* Video Memory: */
    13141317            ++iRowCount;
    1315             const QString strVram = QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize());
    1316             const QString strVramOld = QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachineOld.GetVRAMSize());
     1318            const QString strVram = QApplication::translate("UIDetails", "%1 MB", "details").arg(comGraphics.GetVRAMSize());
     1319            const QString strVramOld = QApplication::translate("UIDetails", "%1 MB", "details").arg(comGraphicsOld.GetVRAMSize());
    13171320            strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Video Memory", "details (display)"),
    13181321                                                     empReport(strVram, strVramOld));
    13191322
    13201323            /* Screens? */
    1321             const int cScreens = comMachine.GetMonitorCount();
    1322             const int cScreensOld = comMachineOld.GetMonitorCount();
     1324            const int cScreens = comGraphics.GetMonitorCount();
     1325            const int cScreensOld = comGraphicsOld.GetMonitorCount();
    13231326            if (cScreens > 1)
    13241327            {
     
    13411344            /* Graphics Controller: */
    13421345            ++iRowCount;
    1343             const QString strGc = gpConverter->toString(comMachine.GetGraphicsControllerType());
    1344             const QString strGcOld = gpConverter->toString(comMachineOld.GetGraphicsControllerType());
     1346            const QString strGc = gpConverter->toString(comGraphics.GetGraphicsControllerType());
     1347            const QString strGcOld = gpConverter->toString(comGraphicsOld.GetGraphicsControllerType());
    13451348            strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"),
    13461349                                                     empReport(strGc, strGcOld));
    13471350
    13481351            /* Acceleration? */
    1349             const QString strAcceleration = displayAccelerationReport(comMachine);
    1350             const QString strAccelerationOld = displayAccelerationReport(comMachineOld);
     1352            const QString strAcceleration = displayAccelerationReport(comGraphics);
     1353            const QString strAccelerationOld = displayAccelerationReport(comGraphicsOld);
    13511354            if (!strAcceleration.isNull())
    13521355            {
     
    17111714
    17121715/* static */
    1713 QString UISnapshotDetailsWidget::displayAccelerationReport(CMachine comMachine)
     1716QString UISnapshotDetailsWidget::displayAccelerationReport(CGraphicsAdapter comGraphics)
    17141717{
    17151718    /* Prepare report: */
     
    17171720#ifdef VBOX_WITH_VIDEOHWACCEL
    17181721    /* 2D Video Acceleration? */
    1719     if (comMachine.GetAccelerate2DVideoEnabled())
     1722    if (comGraphics.GetAccelerate2DVideoEnabled())
    17201723        aReport << QApplication::translate("UIDetails", "2D Video", "details (display)");
    17211724#endif
    17221725    /* 3D Acceleration? */
    1723     if (comMachine.GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
     1726    if (comGraphics.GetAccelerate3DEnabled() && uiCommon().is3DAvailable())
    17241727        aReport << QApplication::translate("UIDetails", "3D", "details (display)");
    17251728    /* Compose and return report: */
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.h

    r76581 r81964  
    3131/* COM includes: */
    3232#include "COMEnums.h"
     33#include "CGraphicsAdapter.h"
    3334#include "CMachine.h"
    3435#include "CSnapshot.h"
     
    162163    static double scaleFactorReport(CMachine comMachine);
    163164    /** Acquires @a comMachine display acceleration report. */
    164     static QString displayAccelerationReport(CMachine comMachine);
     165    static QString displayAccelerationReport(CGraphicsAdapter comGraphics);
    165166    /** Acquires @a comMachine VRDE server report. */
    166167    static QStringList vrdeServerReport(CMachine comMachine);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r79365 r81964  
    2828/* COM includes: */
    2929#include "CAudioAdapter.h"
     30#include "CGraphicsAdapter.h"
    3031#include "CUSBController.h"
    3132#include "CUSBDeviceFilters.h"
     
    129130    m_machine.SetMemorySize(field("ram").toUInt());
    130131    /* Correct the VRAM size since API does not take fullscreen memory requirements into account: */
    131     m_machine.SetVRAMSize(qMax(m_machine.GetVRAMSize(), (ULONG)(UICommon::requiredVideoMemory(strTypeId) / _1M)));
     132    CGraphicsAdapter comGraphics = m_machine.GetGraphicsAdapter();
     133    comGraphics.SetVRAMSize(qMax(comGraphics.GetVRAMSize(), (ULONG)(UICommon::requiredVideoMemory(strTypeId) / _1M)));
    132134#endif
    133135
     
    149151    m_machine.SetMemorySize(field("ram").toInt());
    150152
     153    CGraphicsAdapter comGraphics = m_machine.GetGraphicsAdapter();
    151154    /* Graphics Controller type: */
    152     m_machine.SetGraphicsControllerType(comGuestType.GetRecommendedGraphicsController());
     155    comGraphics.SetGraphicsControllerType(comGuestType.GetRecommendedGraphicsController());
    153156
    154157    /* VRAM size - select maximum between recommended and minimum for fullscreen: */
    155     m_machine.SetVRAMSize(qMax(comGuestType.GetRecommendedVRAM(), (ULONG)(UICommon::requiredVideoMemory(strGuestTypeId) / _1M)));
     158    comGraphics.SetVRAMSize(qMax(comGuestType.GetRecommendedVRAM(), (ULONG)(UICommon::requiredVideoMemory(strGuestTypeId) / _1M)));
    156159
    157160    /* Selecting recommended chipset type: */
     
    275278    /* Set graphic bits: */
    276279    if (comGuestType.GetRecommended2DVideoAcceleration())
    277         m_machine.SetAccelerate2DVideoEnabled(comGuestType.GetRecommended2DVideoAcceleration());
     280        comGraphics.SetAccelerate2DVideoEnabled(comGuestType.GetRecommended2DVideoAcceleration());
    278281
    279282    if (comGuestType.GetRecommended3DAcceleration())
    280         m_machine.SetAccelerate3DEnabled(comGuestType.GetRecommended3DAcceleration());
     283        comGraphics.SetAccelerate3DEnabled(comGuestType.GetRecommended3DAcceleration());
    281284}
    282285
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