VirtualBox

Changeset 37928 in vbox for trunk


Ignore:
Timestamp:
Jul 13, 2011 3:54:30 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72838
Message:

Main/MachineDataChangedEvent: new attribute, currently unimplemented

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r37906 r37928  
    1668116681  <interface
    1668216682    name="IMachineDataChangedEvent" extends="IMachineEvent"
    16683     uuid="6AA70A6C-0DCA-4810-8C5C-457B278E3D49"
     16683    uuid="abe94809-2e88-4436-83d7-50f3e64d0503"
    1668416684    wsmap="managed" autogen="VBoxEvent" id="OnMachineDataChanged"
    1668516685    >
     
    1668716687      Any of the settings of the given machine has changed.
    1668816688    </desc>
     16689
     16690    <attribute name="temporary" readonly="yes" type="boolean">
     16691      <desc>@c true if the settings change is temporary. All permanent
     16692        settings changes will trigger an event, and only temporary settings
     16693        changes for running VMs will trigger an event. Note: sending events
     16694        for temporary changes is NOT IMPLEMENTED.</desc>
     16695    </attribute>
    1668916696  </interface>
    1669016697
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r37779 r37928  
    193193
    194194    void onMachineStateChange(const Guid &aId, MachineState_T aState);
    195     void onMachineDataChange(const Guid &aId);
     195    void onMachineDataChange(const Guid &aId, BOOL aTemporary = FALSE);
    196196    BOOL onExtraDataCanChange(const Guid &aId, IN_BSTR aKey, IN_BSTR aValue,
    197197                              Bstr &aError);
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r37779 r37928  
    109109////////////////////////////////////////////////////////////////////////////////
    110110//
    111 // VirtualBoxCallbackRegistration
    112 //
    113 ////////////////////////////////////////////////////////////////////////////////
    114 
    115 /**
    116  * Registered IVirtualBoxCallback, used by VirtualBox::CallbackList and
    117  * VirtualBox::Data::llCallbacks.
    118  *
    119  * In addition to keeping the interface pointer this also keeps track of the
    120  * methods that asked to not be called again.  The latter is for reducing
    121  * unnecessary IPC.
    122  */
    123 class VirtualBoxCallbackRegistration
    124 {
    125 public:
    126     /** Callback bit indexes (for bmDisabled). */
    127     typedef enum
    128     {
    129         kOnMachineStateChanged = 0,
    130         kOnMachineDataChanged,
    131         kOnExtraDataCanChange,
    132         kOnExtraDataChanged,
    133         kOnMediumRegistered,
    134         kOnMachineRegistered,
    135         kOnSessionStateChanged,
    136         kOnSnapshotTaken,
    137         kOnSnapshotDeleted,
    138         kOnSnapshotChanged,
    139         kOnGuestPropertyChanged
    140     } CallbackBit;
    141 
    142     VirtualBoxCallbackRegistration()
    143     {
    144         /* nothing */
    145     }
    146 
    147     ~VirtualBoxCallbackRegistration()
    148     {
    149        /* nothing */
    150     }
    151 };
    152 
    153 ////////////////////////////////////////////////////////////////////////////////
    154 //
    155111// CallbackEvent class
    156112//
     
    171127public:
    172128
    173     CallbackEvent(VirtualBox *aVirtualBox, VirtualBoxCallbackRegistration::CallbackBit aWhat)
     129    CallbackEvent(VirtualBox *aVirtualBox, VBoxEventType_T aWhat)
    174130        : mVirtualBox(aVirtualBox), mWhat(aWhat)
    175131    {
     
    187143     *  is bound to the lifetime of the VirtualBox instance, so it's safe.
    188144     */
    189     VirtualBox        *mVirtualBox;
     145    VirtualBox         *mVirtualBox;
    190146protected:
    191     VirtualBoxCallbackRegistration::CallbackBit mWhat;
     147    VBoxEventType_T    mWhat;
    192148};
    193149
     
    23602316struct MachineEvent : public VirtualBox::CallbackEvent
    23612317{
    2362     MachineEvent(VirtualBox *aVB, const Guid &aId)
    2363         : CallbackEvent(aVB, VirtualBoxCallbackRegistration::kOnMachineDataChanged), id(aId.toUtf16())
     2318    MachineEvent(VirtualBox *aVB, VBoxEventType_T aWhat, const Guid &aId, BOOL aBool)
     2319        : CallbackEvent(aVB, aWhat), id(aId.toUtf16())
     2320        , mBool(aBool)
     2321        { }
     2322
     2323    MachineEvent(VirtualBox *aVB, VBoxEventType_T aWhat, const Guid &aId, MachineState_T aState)
     2324        : CallbackEvent(aVB, aWhat), id(aId.toUtf16())
     2325        , mState(aState)
    23642326        {}
    23652327
    2366     MachineEvent(VirtualBox *aVB, const Guid &aId, MachineState_T aState)
    2367         : CallbackEvent(aVB, VirtualBoxCallbackRegistration::kOnMachineStateChanged), id(aId.toUtf16())
    2368         , state(aState)
    2369         {}
    2370 
    2371     MachineEvent(VirtualBox *aVB, const Guid &aId, BOOL aRegistered)
    2372         : CallbackEvent(aVB, VirtualBoxCallbackRegistration::kOnMachineRegistered), id(aId.toUtf16())
    2373         , registered(aRegistered)
    2374         {}
    2375 
    23762328    virtual HRESULT prepareEventDesc(IEventSource* aSource, VBoxEventDesc& aEvDesc)
    23772329    {
    23782330        switch (mWhat)
    23792331        {
    2380             case VirtualBoxCallbackRegistration::kOnMachineDataChanged:
    2381                 aEvDesc.init(aSource, VBoxEventType_OnMachineDataChanged, id.raw());
     2332            case VBoxEventType_OnMachineDataChanged:
     2333                aEvDesc.init(aSource, mWhat, id.raw(), mBool);
    23822334                break;
    23832335
    2384             case VirtualBoxCallbackRegistration::kOnMachineStateChanged:
    2385                 aEvDesc.init(aSource, VBoxEventType_OnMachineStateChanged, id.raw(), state);
     2336            case VBoxEventType_OnMachineStateChanged:
     2337                aEvDesc.init(aSource, mWhat, id.raw(), mState);
    23862338                break;
    23872339
    2388             case VirtualBoxCallbackRegistration::kOnMachineRegistered:
    2389                 aEvDesc.init(aSource, VBoxEventType_OnMachineRegistered, id.raw(), registered);
     2340            case VBoxEventType_OnMachineRegistered:
     2341                aEvDesc.init(aSource, mWhat, id.raw(), mBool);
    23902342                break;
    23912343
     
    23972349
    23982350    Bstr id;
    2399     MachineState_T state;
    2400     BOOL registered;
     2351    MachineState_T mState;
     2352    BOOL mBool;
    24012353};
    24022354
     
    24062358void VirtualBox::onMachineStateChange(const Guid &aId, MachineState_T aState)
    24072359{
    2408     postEvent(new MachineEvent(this, aId, aState));
     2360    postEvent(new MachineEvent(this, VBoxEventType_OnMachineStateChanged, aId, aState));
    24092361}
    24102362
     
    24122364 *  @note Doesn't lock any object.
    24132365 */
    2414 void VirtualBox::onMachineDataChange(const Guid &aId)
    2415 {
    2416     postEvent(new MachineEvent(this, aId));
     2366void VirtualBox::onMachineDataChange(const Guid &aId, BOOL aTemporary)
     2367{
     2368    postEvent(new MachineEvent(this, VBoxEventType_OnMachineDataChanged, aId, aTemporary));
    24172369}
    24182370
     
    24662418    ExtraDataEvent(VirtualBox *aVB, const Guid &aMachineId,
    24672419                   IN_BSTR aKey, IN_BSTR aVal)
    2468         : CallbackEvent(aVB, VirtualBoxCallbackRegistration::kOnExtraDataChanged)
     2420        : CallbackEvent(aVB, VBoxEventType_OnExtraDataChanged)
    24692421        , machineId(aMachineId.toUtf16()), key(aKey), val(aVal)
    24702422    {}
     
    24912443void VirtualBox::onMachineRegistered(const Guid &aId, BOOL aRegistered)
    24922444{
    2493     postEvent(new MachineEvent(this, aId, aRegistered));
     2445    postEvent(new MachineEvent(this, VBoxEventType_OnMachineRegistered, aId, aRegistered));
    24942446}
    24952447
     
    24982450{
    24992451    SessionEvent(VirtualBox *aVB, const Guid &aMachineId, SessionState_T aState)
    2500         : CallbackEvent(aVB, VirtualBoxCallbackRegistration::kOnSessionStateChanged)
     2452        : CallbackEvent(aVB, VBoxEventType_OnSessionStateChanged)
    25012453        , machineId(aMachineId.toUtf16()), sessionState(aState)
    25022454    {}
     
    25222474{
    25232475    SnapshotEvent(VirtualBox *aVB, const Guid &aMachineId, const Guid &aSnapshotId,
    2524                   VirtualBoxCallbackRegistration::CallbackBit aWhat)
     2476                  VBoxEventType_T aWhat)
    25252477        : CallbackEvent(aVB, aWhat)
    25262478        , machineId(aMachineId), snapshotId(aSnapshotId)
     
    25432495{
    25442496    postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
    2545                                 VirtualBoxCallbackRegistration::kOnSnapshotTaken));
     2497                                VBoxEventType_OnSnapshotTaken));
    25462498}
    25472499
     
    25522504{
    25532505    postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
    2554                                 VirtualBoxCallbackRegistration::kOnSnapshotDeleted));
     2506                                VBoxEventType_OnSnapshotDeleted));
    25552507}
    25562508
     
    25612513{
    25622514    postEvent(new SnapshotEvent(this, aMachineId, aSnapshotId,
    2563                                 VirtualBoxCallbackRegistration::kOnSnapshotChanged));
     2515                                VBoxEventType_OnSnapshotChanged));
    25642516}
    25652517
     
    25692521    GuestPropertyEvent(VirtualBox *aVBox, const Guid &aMachineId,
    25702522                       IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags)
    2571         : CallbackEvent(aVBox, VirtualBoxCallbackRegistration::kOnGuestPropertyChanged),
     2523        : CallbackEvent(aVBox, VBoxEventType_OnGuestPropertyChanged),
    25722524          machineId(aMachineId),
    25732525          name(aName),
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