VirtualBox

Changeset 1721 in vbox


Ignore:
Timestamp:
Mar 27, 2007 11:46:18 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19878
Message:

Implemented new 'MonitorCount' VM setting, to be used by VGA device and NT guest driver.

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

Legend:

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

    r1681 r1721  
    43374337    BSTR            str = NULL;
    43384338    ULONG           cRamMBs;
     4339    ULONG           cMonitors;
    43394340    unsigned        i;
    43404341
     
    47374738    hrc = pMachine->COMGETTER(VRAMSize)(&cRamMBs);                                  H();
    47384739    rc = CFGMR3InsertInteger(pCfg,  "VRamSize",             cRamMBs * _1M);         RC_CHECK();
     4740    hrc = pMachine->COMGETTER(MonitorCount)(&cMonitors);                            H();
     4741    rc = CFGMR3InsertInteger(pCfg,  "MonitorCount",         cMonitors);             RC_CHECK();
    47394742
    47404743    /* Custom VESA mode list */
     
    53355338                break;
    53365339            }
    5337 #endif 
     5340#endif
    53385341        }
    53395342    }
  • trunk/src/VBox/Main/MachineImpl.cpp

    r1551 r1721  
    162162    mMemorySize = 128;
    163163    mVRAMSize = 8;
     164    mMonitorCount = 1;
    164165    mHWVirtExEnabled = TriStateBool_False;
    165166
     
    185186    if (mMemorySize != that.mMemorySize ||
    186187        mVRAMSize != that.mVRAMSize ||
     188        mMonitorCount != that.mMonitorCount ||
    187189        mHWVirtExEnabled != that.mHWVirtExEnabled ||
    188190        mClipboardMode != that.mClipboardMode)
     
    944946    mHWData.backup();
    945947    mHWData->mVRAMSize = memorySize;
     948
     949    return S_OK;
     950}
     951
     952STDMETHODIMP Machine::COMGETTER(MonitorCount) (ULONG *monitorCount)
     953{
     954    if (!monitorCount)
     955        return E_POINTER;
     956
     957    AutoCaller autoCaller (this);
     958    CheckComRCReturnRC (autoCaller.rc());
     959
     960    AutoReaderLock alock (this);
     961
     962    *monitorCount = mHWData->mMonitorCount;
     963
     964    return S_OK;
     965}
     966
     967STDMETHODIMP Machine::COMSETTER(MonitorCount) (ULONG monitorCount)
     968{
     969    /* make sure monitor count is a sensible number */
     970    if (monitorCount < 1 || monitorCount > SchemaDefs::MaxGuestMonitors)
     971        return setError (E_INVALIDARG,
     972            tr ("Invalid monitor count: %lu (must be in range [%lu, %lu])"),
     973                monitorCount, 1, SchemaDefs::MaxGuestMonitors);
     974
     975    AutoCaller autoCaller (this);
     976    CheckComRCReturnRC (autoCaller.rc());
     977
     978    AutoLock alock (this);
     979
     980    CHECK_SETTER();
     981
     982    mHWData.backup();
     983    mHWData->mMonitorCount = monitorCount;
    946984
    947985    return S_OK;
     
    35443582        CFGLDRQueryUInt32 (displayNode, "VRAMSize", &VRAMSize);
    35453583        mHWData->mVRAMSize = VRAMSize;
     3584
     3585        uint32_t MonitorCount;
     3586        CFGLDRQueryUInt32 (displayNode, "MonitorCount", &MonitorCount);
     3587        mHWData->mMonitorCount = MonitorCount;
     3588
    35463589        CFGLDRReleaseNode (displayNode);
    35473590    }
     
    39523995        else if (driver == L"coreaudio")
    39533996            audioDriver = AudioDriverType_CoreAudioDriver;
    3954 #endif 
     3997#endif
    39553998        else
    39563999            AssertMsgFailed (("Invalid driver: %ls\n", driver.raw()));
     
    54025445        CFGLDRCreateChildNode (aNode, "Display", &displayNode);
    54035446        CFGLDRSetUInt32 (displayNode, "VRAMSize", mHWData->mVRAMSize);
     5447        CFGLDRSetUInt32 (displayNode, "MonitorCount", mHWData->mMonitorCount);
    54045448        CFGLDRReleaseNode (displayNode);
    54055449    }
     
    57515795                break;
    57525796            }
    5753 #endif 
     5797#endif
    57545798            default:
    57555799                ComAssertMsgFailedBreak (("Wrong audio driver type! driver = %d\n",
  • trunk/src/VBox/Main/SystemPropertiesImpl.cpp

    r1 r1721  
    145145}
    146146
     147STDMETHODIMP SystemProperties::COMGETTER(MaxGuestMonitors)(ULONG *maxMonitors)
     148{
     149    if (!maxMonitors)
     150        return E_POINTER;
     151    AutoLock lock(this);
     152    CHECK_READY();
     153
     154    *maxMonitors = SchemaDefs::MaxGuestMonitors;
     155
     156    return S_OK;
     157}
     158
    147159STDMETHODIMP SystemProperties::COMGETTER(MaxVDISize)(ULONG64 *maxVDISize)
    148160{
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r1551 r1721  
    19361936        </attribute>
    19371937
     1938        <attribute name="MonitorCount" type="unsigned long">
     1939            <desc>
     1940                Number of virtual monitors.
     1941                <note>
     1942                    Only effective on Windows XP and later guests with
     1943                    Guest Additions installed.
     1944                </note>
     1945            </desc>
     1946        </attribute>
     1947
    19381948        <attribute name="BIOSSettings" type="IBIOSSettings" readonly="yes">
    19391949            <desc>Object containing all BIOS settings.</desc>
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r1 r1721  
    7575    uint32_t mVRAMSize;
    7676    uint32_t mHDDSize;
     77    uint32_t mMonitorCount;
    7778};
    7879
  • trunk/src/VBox/Main/include/MachineImpl.h

    r1077 r1721  
    243243        ULONG          mMemorySize;
    244244        ULONG          mVRAMSize;
     245        ULONG          mMonitorCount;
    245246        TriStateBool_T mHWVirtExEnabled;
    246247
     
    319320    STDMETHOD(COMGETTER(VRAMSize))(ULONG *memorySize);
    320321    STDMETHOD(COMSETTER(VRAMSize))(ULONG memorySize);
     322    STDMETHOD(COMGETTER(MonitorCount))(ULONG *monitorCount);
     323    STDMETHOD(COMSETTER(MonitorCount))(ULONG monitorCount);
    321324    STDMETHOD(COMGETTER(BIOSSettings))(IBIOSSettings **biosSettings);
    322325    STDMETHOD(COMGETTER(HWVirtExEnabled))(TriStateBool_T *enabled);
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r1 r1721  
    6060    STDMETHOD(COMGETTER(MinGuestVRAM)(ULONG *minVRAM));
    6161    STDMETHOD(COMGETTER(MaxGuestVRAM)(ULONG *maxVRAM));
     62    STDMETHOD(COMGETTER(MaxGuestMonitors)(ULONG *maxMonitors));
    6263    STDMETHOD(COMGETTER(MaxVDISize)(ULONG64 *maxVDISize));
    6364    STDMETHOD(COMGETTER(NetworkAdapterCount)(ULONG *count));
  • trunk/src/VBox/Main/xml/SchemaDefs.xsl

    r1 r1721  
    125125  </xsl:call-template>
    126126  <xsl:call-template name="defineEnumMember">
     127      <xsl:with-param name="member" select="'        MaxGuestMonitors'"/>
     128      <xsl:with-param name="select" select="
     129        xsd:complexType[@name='TDisplay']/xsd:attribute[@name='MonitorCount']//xsd:maxInclusive/@value
     130      "/>
     131  </xsl:call-template>
     132  <xsl:call-template name="defineEnumMember">
    127133      <xsl:with-param name="member" select="'        NetworkAdapterCount'"/>
    128134      <xsl:with-param name="select" select="
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r1302 r1721  
    378378    </xsd:simpleType>
    379379  </xsd:attribute>
     380  <xsd:attribute name="MonitorCount" default="1">
     381    <xsd:simpleType>
     382      <xsd:restriction base="xsd:unsignedInt">
     383        <xsd:maxInclusive value="8"/>
     384      </xsd:restriction>
     385    </xsd:simpleType>
     386  </xsd:attribute>
    380387</xsd:complexType>
    381388
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