VirtualBox

Changeset 22143 in vbox for trunk


Ignore:
Timestamp:
Aug 10, 2009 7:12:18 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50914
Message:

video 2d accel: Main & ui settings

Location:
trunk/src/VBox
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r21833 r22143  
    752752    static QString documentsPath();
    753753
     754#ifdef VBOX_WITH_VIDEOHWACCEL
     755    static bool isAcceleration2DVideoAvailable() {/*TODO: */ return true;}
     756#endif
     757
    754758signals:
    755759
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r22141 r22143  
    15581558
    15591559        rows += 2;
     1560
     1561#ifdef VBOX_WITH_VIDEOHWACCEL
     1562        QString acc2dVideo = aMachine.GetAccelerate2DVideoEnabled()
     1563            ? tr ("Enabled", "details report (2D Video Acceleration)")
     1564            : tr ("Disabled", "details report (2D Video Acceleration)");
     1565
     1566        item += QString (sSectionItemTpl2)
     1567                       .arg (tr ("2D Video Acceleration", "details report"), acc2dVideo);
     1568        rows++;
     1569#endif
    15601570
    15611571        /* VRDP tab */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsDisplay.cpp

    r21194 r22143  
    9595#endif /* QT_MAC_USE_COCOA */
    9696
     97#ifndef VBOX_WITH_VIDEOHWACCEL
     98    mCb2DVideo->setEnabled (false);
     99#endif
     100
    97101    /* Applying language settings */
    98102    retranslateUi();
     
    112116    mCb3D->setChecked (mMachine.GetAccelerate3DEnabled());
    113117
     118#ifdef VBOX_WITH_VIDEOHWACCEL
     119    bool is2DVideoAccelerationSupported = VBoxGlobal::isAcceleration2DVideoAvailable();
     120    mCb2DVideo->setEnabled (is2DVideoAccelerationSupported);
     121    mCb2DVideo->setChecked (mMachine.GetAccelerate2DVideoEnabled());
     122#else
     123    mCb2DVideo->setEnabled (false);
     124#endif
     125
    114126    /* VRDP Settings */
    115127    CVRDPServer vrdp = mMachine.GetVRDPServer();
     
    137149    mMachine.SetAccelerate3DEnabled (mCb3D->isChecked());
    138150
     151#ifdef VBOX_WITH_VIDEOHWACCEL
     152    /* 2D Video Acceleration */
     153    mMachine.SetAccelerate2DVideoEnabled (mCb2DVideo->isChecked());
     154#endif
     155
    139156    /* VRDP Settings */
    140157    CVRDPServer vrdp = mMachine.GetVRDPServer();
     
    153170    connect (mCb3D, SIGNAL (stateChanged (int)),
    154171             mValidator, SLOT (revalidate()));
     172#ifdef VBOX_WITH_VIDEOHWACCEL
     173    connect (mCb2DVideo, SIGNAL (stateChanged (int)),
     174             mValidator, SLOT (revalidate()));
     175#endif
    155176    connect (mCbVRDP, SIGNAL (toggled (bool)),
    156177             mValidator, SLOT (revalidate()));
     
    187208    setTabOrder (mSlMemory, mLeMemory);
    188209    setTabOrder (mLeMemory, mCb3D);
    189 
     210#ifdef VBOX_WITH_VIDEOHWACCEL
     211    setTabOrder (mCb3D, mCb2DVideo);
     212    setTabOrder (mCb2DVideo, mCbVRDP);
     213#else
    190214    setTabOrder (mCb3D, mCbVRDP);
     215#endif
    191216    setTabOrder (mCbVRDP, mLeVRDPPort);
    192217    setTabOrder (mLeVRDPPort, mCbVRDPMethod);
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDisplay.ui

    r21119 r22143  
    177177           </widget>
    178178          </item>
     179          <item row="3" column="1" colspan="2">
     180           <widget class="QCheckBox" name="mCb2DVideo">
     181            <property name="sizePolicy">
     182             <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     183              <horstretch>0</horstretch>
     184              <verstretch>0</verstretch>
     185             </sizepolicy>
     186            </property>
     187            <property name="whatsThis">
     188             <string>When checked, the virtual machine will get access to the Video Acceleration capabilities available on the host.</string>
     189            </property>
     190            <property name="text">
     191             <string>Enable &amp;2D Video Acceleration</string>
     192            </property>
     193           </widget>
     194          </item>
    179195         </layout>
    180196        </widget>
  • trunk/src/VBox/Main/MachineImpl.cpp

    r21961 r22143  
    193193    mVRAMSize = 8;
    194194    mAccelerate3DEnabled = false;
     195    mAccelerate2DVideoEnabled = false;
    195196    mMonitorCount = 1;
    196197    mHWVirtExEnabled = true;
     
    226227        mVRAMSize != that.mVRAMSize ||
    227228        mAccelerate3DEnabled != that.mAccelerate3DEnabled ||
     229        mAccelerate2DVideoEnabled != that.mAccelerate2DVideoEnabled ||
    228230        mMonitorCount != that.mMonitorCount ||
    229231        mHWVirtExEnabled != that.mHWVirtExEnabled ||
     
    11861188}
    11871189
     1190
     1191STDMETHODIMP Machine::COMGETTER(Accelerate2DVideoEnabled)(BOOL *enabled)
     1192{
     1193    if (!enabled)
     1194        return E_POINTER;
     1195
     1196    AutoCaller autoCaller(this);
     1197    CheckComRCReturnRC(autoCaller.rc());
     1198
     1199    AutoReadLock alock(this);
     1200
     1201    *enabled = mHWData->mAccelerate2DVideoEnabled;
     1202
     1203    return S_OK;
     1204}
     1205
     1206STDMETHODIMP Machine::COMSETTER(Accelerate2DVideoEnabled)(BOOL enable)
     1207{
     1208    AutoCaller autoCaller(this);
     1209    CheckComRCReturnRC(autoCaller.rc());
     1210
     1211    AutoWriteLock alock(this);
     1212
     1213    HRESULT rc = checkStateDependency(MutableStateDep);
     1214    CheckComRCReturnRC(rc);
     1215
     1216    /** @todo check validity! */
     1217
     1218    mHWData.backup();
     1219    mHWData->mAccelerate2DVideoEnabled = enable;
     1220
     1221    return S_OK;
     1222}
    11881223
    11891224STDMETHODIMP Machine::COMGETTER(MonitorCount) (ULONG *monitorCount)
     
    52745309        mHWData->mMonitorCount  = displayNode.value <ULONG> ("monitorCount");
    52755310        mHWData->mAccelerate3DEnabled = displayNode.value <bool> ("accelerate3D");
     5311        mHWData->mAccelerate2DVideoEnabled = displayNode.value <bool> ("accelerate2DVideo");
    52765312    }
    52775313
     
    67266762        displayNode.setValue <ULONG> ("monitorCount", mHWData->mMonitorCount);
    67276763        displayNode.setValue <bool> ("accelerate3D", !!mHWData->mAccelerate3DEnabled);
     6764        displayNode.setValue <bool> ("accelerate2DVideo", !!mHWData->mAccelerate2DVideoEnabled);
    67286765    }
    67296766
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r21970 r22143  
    40104010  <interface
    40114011     name="IMachine" extends="$unknown"
    4012      uuid="540dcfda-3df2-49c6-88fa-033a28c2ff85"
     4012     uuid="5293aa45-5ab5-4f70-852e-bb43f5a46491"
    40134013     wsmap="managed"
    40144014     >
     
    42234223        of the 3D graphics support available on the host. Currently limited
    42244224        to OpenGL only. </desc>
     4225    </attribute>
     4226   
     4227    <attribute name="accelerate2DVideoEnabled" type="boolean" default="false">
     4228      <desc>
     4229        This setting determines whether VirtualBox allows guests to make use
     4230        of the 2D Video graphics support available on the host. </desc>
    42254231    </attribute>
    42264232
  • trunk/src/VBox/Main/include/MachineImpl.h

    r21961 r22143  
    271271        BOOL           mHWVirtExVPIDEnabled;
    272272        BOOL           mAccelerate3DEnabled;
     273        BOOL           mAccelerate2DVideoEnabled;
    273274        BOOL           mPAEEnabled;
    274275        ULONG          mCPUCount;
     
    504505    STDMETHOD(COMGETTER(Accelerate3DEnabled))(BOOL *enabled);
    505506    STDMETHOD(COMSETTER(Accelerate3DEnabled))(BOOL enabled);
     507    STDMETHOD(COMGETTER(Accelerate2DVideoEnabled))(BOOL *enabled);
     508    STDMETHOD(COMSETTER(Accelerate2DVideoEnabled))(BOOL enabled);
    506509    STDMETHOD(COMGETTER(BIOSSettings))(IBIOSSettings **biosSettings);
    507510    STDMETHOD(COMGETTER(HWVirtExEnabled))(BOOL *enabled);
  • trunk/src/VBox/Main/include/VirtualBoxXMLUtil.h

    r17669 r22143  
    2929
    3030/** VirtualBox XML settings version number substring ("x.y")  */
    31 #define VBOX_XML_VERSION        "1.7"
     31#define VBOX_XML_VERSION        "1.8"
    3232
    3333/** VirtualBox XML settings version platform substring */
  • trunk/src/VBox/Main/xml/SettingsConverter.xsl

    r21447 r22143  
    141141    <xsl:attribute name="version"><xsl:value-of select="concat('1.7','-',$curVerPlat)"/></xsl:attribute>
    142142    <xsl:apply-templates select="node()" mode="v1.7"/>
     143  </xsl:copy>
     144</xsl:template>
     145
     146<!-- 1.7 => 1.8 -->
     147<xsl:template match="/vb:VirtualBox[substring-before(@version,'-')='1.7']">
     148  <xsl:copy>
     149    <xsl:attribute name="version"><xsl:value-of select="concat('1.8','-',$curVerPlat)"/></xsl:attribute>
     150    <xsl:apply-templates select="node()" mode="v1.8"/>
    143151  </xsl:copy>
    144152</xsl:template>
     
    976984<!--
    977985 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     986 *  1.7 => 1.8
     987 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     988-->
     989<!--
     990 *  all non-root elements that are not explicitly matched are copied as is
     991-->
     992<xsl:template match="@*|node()[../..]" mode="v1.8">
     993  <xsl:copy>
     994    <xsl:apply-templates select="@*|node()[../..]" mode="v1.8"/>
     995  </xsl:copy>
     996</xsl:template>
     997
     998<!--
     999 *  Global settings
     1000-->
     1001
     1002<!--
     1003 *  Machine settings
     1004-->
     1005
     1006<!--xsl:template match="vb:VirtualBox[substring-before(@version,'-')='1.7']/
     1007                     vb:Machine//vb:Hardware/vb:Display"
     1008              mode="v1.8">
     1009  <xsl:copy>
     1010    <xsl:apply-templates select="node()" mode="v1.8"/>
     1011    <xsl:for-each select="@*">
     1012      <xsl:choose>
     1013        <xsl:when test="name()='Accelerate2DVideo'">
     1014          <xsl:attribute name="accelerate2DVideo"><xsl:value-of select="."/></xsl:attribute>
     1015        </xsl:when>
     1016        <xsl:otherwise>
     1017          <xsl:apply-templates select="." mode="v1.8"/>
     1018        </xsl:otherwise>
     1019      </xsl:choose>
     1020    </xsl:for-each>
     1021  </xsl:copy>
     1022</xsl:template-->
     1023
     1024<!--
     1025 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    9781026-->
    9791027
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r19726 r22143  
    500500  </xsd:attribute>
    501501  <xsd:attribute name="accelerate3D" type="xsd:boolean" default="false"/>
     502  <xsd:attribute name="accelerate2DVideo" type="xsd:boolean" default="false"/>
    502503</xsd:complexType>
    503504
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