VirtualBox

Changeset 32086 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 30, 2010 12:08:30 PM (14 years ago)
Author:
vboxsync
Message:

Guest Additions Runlevels: Use a Main enum for run level type.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

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

    r32020 r32086  
    19331933            }
    19341934
    1935             ULONG guestRunLevel;
     1935            AdditionsRunLevelType_T guestRunLevel; /** @todo Add a runlevel-to-string (e.g. 0 = "None") method? */
    19361936            rc = guest->COMGETTER(AdditionsRunLevel)(&guestRunLevel);
    19371937            if (SUCCEEDED(rc))
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r32020 r32086  
    104104
    105105    /* Guest additions state getters: */
    106     bool isGuestAdditionsActive() const { return (m_ulGuestAdditionsRunLevel > 0); }
     106    bool isGuestAdditionsActive() const { return (m_ulGuestAdditionsRunLevel > AdditionsRunLevelType_None); }
    107107    bool isGuestSupportsGraphics() const { return isGuestAdditionsActive() && m_fIsGuestSupportsGraphics; }
    108108    bool isGuestSupportsSeamless() const { return isGuestSupportsGraphics() && m_fIsGuestSupportsSeamless; }
  • trunk/src/VBox/Main/GuestImpl.cpp

    r32020 r32086  
    160160}
    161161
    162 STDMETHODIMP Guest::COMGETTER(AdditionsRunLevel) (ULONG *aRunLevel)
     162STDMETHODIMP Guest::COMGETTER(AdditionsRunLevel) (AdditionsRunLevelType_T *aRunLevel)
    163163{
    164164    AutoCaller autoCaller(this);
     
    184184    if (   mData.mAdditionsVersion.isEmpty()
    185185        /* Only try alternative way if GA are active! */
    186         && mData.mAdditionsRunLevel > VBoxGuestAdditionsRunLevel_None)
     186        && mData.mAdditionsRunLevel > AdditionsRunLevelType_None)
    187187    {
    188188        /*
     
    429429}
    430430
    431 STDMETHODIMP Guest::GetAdditionsStatus(ULONG aLevel, BOOL *aActive)
     431STDMETHODIMP Guest::GetAdditionsStatus(AdditionsRunLevelType_T aLevel, BOOL *aActive)
    432432{
    433433    AutoCaller autoCaller(this);
     
    439439    switch (aLevel)
    440440    {
    441         case 0: /* System */
    442             *aActive = (mData.mAdditionsRunLevel > VBoxGuestAdditionsRunLevel_None);
     441        case AdditionsRunLevelType_System:
     442            *aActive = (mData.mAdditionsRunLevel > AdditionsRunLevelType_None);
    443443            break;
    444444
    445         case 1: /* Userland */
    446             *aActive = (mData.mAdditionsRunLevel >= VBoxGuestAdditionsRunLevel_Userland);
     445        case AdditionsRunLevelType_Userland:
     446            *aActive = (mData.mAdditionsRunLevel >= AdditionsRunLevelType_Userland);
    447447            break;
    448448
    449         case 2: /* Desktop */
    450             *aActive = (mData.mAdditionsRunLevel >= VBoxGuestAdditionsRunLevel_Desktop);
     449        case AdditionsRunLevelType_Desktop:
     450            *aActive = (mData.mAdditionsRunLevel >= AdditionsRunLevelType_Desktop);
    451451            break;
    452452
     
    15201520    {
    15211521        mData.mAdditionsRunLevel = aInterfaceVersion.isEmpty()
    1522                                  ? VBoxGuestAdditionsRunLevel_None
    1523                                  : VBoxGuestAdditionsRunLevel_System;
     1522                                 ? AdditionsRunLevelType_None
     1523                                 : AdditionsRunLevelType_System;
    15241524    }
    15251525
     
    15291529     * and use the setSupportedFeatures function instead.
    15301530     */
    1531     mData.mSupportsGraphics = mData.mAdditionsRunLevel > VBoxGuestAdditionsRunLevel_None;
     1531    mData.mSupportsGraphics = mData.mAdditionsRunLevel > AdditionsRunLevelType_None;
    15321532
    15331533    /*
     
    15891589       )
    15901590    {
    1591         mData.mAdditionsRunLevel = VBoxGuestAdditionsRunLevel_None;
     1591        mData.mAdditionsRunLevel = AdditionsRunLevelType_None;
    15921592    }
    15931593    else if (uCurFacility >= VBoxGuestStatusFacility_VBoxTray)
    15941594    {
    1595         mData.mAdditionsRunLevel = VBoxGuestAdditionsRunLevel_Desktop;
     1595        mData.mAdditionsRunLevel = AdditionsRunLevelType_Desktop;
    15961596    }
    15971597    else if (uCurFacility >= VBoxGuestStatusFacility_VBoxService)
    15981598    {
    1599         mData.mAdditionsRunLevel = VBoxGuestAdditionsRunLevel_Userland;
     1599        mData.mAdditionsRunLevel = AdditionsRunLevelType_Userland;
    16001600    }
    16011601    else if (uCurFacility >= VBoxGuestStatusFacility_VBoxGuestDriver)
    16021602    {
    1603         mData.mAdditionsRunLevel = VBoxGuestAdditionsRunLevel_System;
     1603        mData.mAdditionsRunLevel = AdditionsRunLevelType_System;
    16041604    }
    16051605    else /* Should never happen! */
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r32074 r32086  
    76447644  </interface>
    76457645
     7646  <enum
     7647    name="AdditionsRunLevelType"
     7648    uuid="a25417ee-a9dd-4f5b-b0dc-377860087754"
     7649  >
     7650    <desc>
     7651      Guest Additions run level type.
     7652    </desc>
     7653
     7654    <const name="None"     value="0">
     7655      <desc>Guest Additions are not loaded.</desc>
     7656    </const>
     7657    <const name="System"   value="1">
     7658        <desc>Guest drivers are loaded.</desc>
     7659    </const>
     7660    <const name="Userland" value="2">
     7661        <desc>Common components (such as application services) are loaded.</desc>
     7662    </const>
     7663    <const name="Desktop"  value="3">
     7664        <desc>Per-user desktop components are loaded.</desc>
     7665    </const>
     7666  </enum>
     7667
    76467668  <interface
    76477669     name="IGuest" extends="$unknown"
     
    76737695    </attribute>
    76747696
    7675     <attribute name="additionsRunLevel" type="unsigned long" readonly="yes">
     7697    <attribute name="additionsRunLevel" type="AdditionsRunLevelType" readonly="yes">
    76767698      <desc>
    76777699        Current run level of the Guest Additions.
     
    77657787
    77667788      </desc>
    7767       <param name="level" type="unsigned long" dir="in">
     7789      <param name="level" type="AdditionsRunLevelType" dir="in">
    77687790        <desc>Status level to check</desc>
    77697791      </param>
  • trunk/src/VBox/Main/include/GuestImpl.h

    r32020 r32086  
    7575    // IGuest properties
    7676    STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId);
    77     STDMETHOD(COMGETTER(AdditionsRunLevel)) (ULONG *aRunLevel);
     77    STDMETHOD(COMGETTER(AdditionsRunLevel)) (AdditionsRunLevelType_T *aRunLevel);
    7878    STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
    7979    /** @todo Remove later by replacing it by AdditionsFeatureAvailable(). */
     
    9090
    9191    // IGuest methods
    92     STDMETHOD(GetAdditionsStatus)(ULONG aLevel, BOOL *aActive);
     92    STDMETHOD(GetAdditionsStatus)(AdditionsRunLevelType_T aLevel, BOOL *aActive);
    9393    STDMETHOD(SetCredentials)(IN_BSTR aUserName, IN_BSTR aPassword,
    9494                              IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
     
    160160# endif
    161161
    162     /**
    163      * Guest additions run level.
    164      */
    165     enum VBoxGuestAdditionsRunLevel
    166     {
    167         VBoxGuestAdditionsRunLevel_None     = 0,
    168         VBoxGuestAdditionsRunLevel_System   = 100,
    169         VBoxGuestAdditionsRunLevel_Userland = 200,
    170         VBoxGuestAdditionsRunLevel_Desktop  = 400,
    171         VBoxGuestAdditionsRunLevel_SizeHack = 0x7fffffff
    172     };
    173 
    174162    struct Data
    175163    {
    176         Data() : mAdditionsRunLevel (0), mSupportsSeamless (FALSE),
     164        Data() : mAdditionsRunLevel (AdditionsRunLevelType_None),
     165                 mSupportsSeamless (FALSE),
    177166                 mSupportsGraphics (FALSE) {}
    178167
    179         Bstr     mOSTypeId;
    180         uint32_t mAdditionsRunLevel;
    181         Bstr     mAdditionsVersion;
    182         Bstr     mInterfaceVersion;
    183         BOOL     mSupportsSeamless;
    184         BOOL     mSupportsGraphics;
     168        Bstr                    mOSTypeId;
     169        AdditionsRunLevelType_T mAdditionsRunLevel;
     170        Bstr                    mAdditionsVersion;
     171        Bstr                    mInterfaceVersion;
     172        BOOL                    mSupportsSeamless;
     173        BOOL                    mSupportsGraphics;
    185174    };
    186175
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