VirtualBox

Changeset 30510 in vbox


Ignore:
Timestamp:
Jun 29, 2010 4:05:38 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63210
Message:

Main: events work, firing of events enabled

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

Legend:

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

    r30434 r30510  
    586586    AssertReturn(mAudioSniffer, E_FAIL);
    587587
     588    unconst(mEventSource).createObject();
     589    rc = mEventSource->init(static_cast<IConsole*>(this));
     590    AssertComRCReturnRC(rc);
     591
    588592#ifdef RT_OS_WINDOWS
    589593    if (SUCCEEDED(rc))
     
    703707    unconst(mControl).setNull();
    704708    unconst(mMachine).setNull();
     709
     710    // we don't perform uninit() as it's possible that some pending event refers to this source
     711    unconst(mEventSource).setNull();
    705712
    706713    /* Release all callbacks. Do this after uninitializing the components,
     
    17151722    SafeIfaceArray<ISharedFolder> sf(mSharedFolders);
    17161723    sf.detachTo(ComSafeArrayOutArg(aSharedFolders));
     1724
     1725    return S_OK;
     1726}
     1727
     1728
     1729STDMETHODIMP Console::COMGETTER(EventSource)(IEventSource ** aEventSource)
     1730{
     1731    CheckComArgOutPointerValid(aEventSource);
     1732
     1733    AutoCaller autoCaller(this);
     1734    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     1735
     1736    // no need to lock - lifetime constant
     1737    mEventSource.queryInterfaceTo(aEventSource);
    17171738
    17181739    return S_OK;
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r30381 r30510  
    46884688#endif
    46894689
    4690 #if 0
     4690#if 1
    46914691    // We disable generic events firing for now to not harm performance, but it is already functional
    46924692    {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r30476 r30510  
    68646864    </attribute>
    68656865
     6866    <attribute name="eventSource" type="IEventSource" readonly="yes">
     6867      <desc>
     6868        Event source for console events.
     6869      </desc>
     6870    </attribute>
     6871
    68666872    <method name="powerUp">
    68676873      <desc>
     
    1456514571  <enum
    1456614572     name="VBoxEventType"
    14567      uuid="dc336827-bc9b-4acc-8880-691f6943bb8b">
     14573     uuid="25bf47c8-9972-4274-86ea-e6c479796c4a">
    1456814574
    1456914575    <desc>
     
    1459814604    </const>
    1459914605
     14606    <const name="InputEvent" value="4">
     14607      <desc>
     14608        Wildcard for all input device (keyboard, mouse) events.
     14609        Events of this type are never delivered, and only used in
     14610        registerListener() call to simplify registration.
     14611      </desc>
     14612    </const>
    1460014613
    1460114614    <const name="LastWildcard" value="31">
     
    1462014633      </desc>
    1462114634    </const>
    14622     <const name="OnMediumRegistered" value="35">
     14635     <const name="OnExtraDataCanChange" value="35">
     14636      <desc>
     14637        <see>IVirtualBoxCallback::onExtraDataChange</see>
     14638      </desc>
     14639    </const>
     14640    <const name="OnMediumRegistered" value="36">
    1462314641      <desc>
    1462414642        <see>IVirtualBoxCallback::onMediumRegistered</see>
    1462514643      </desc>
    1462614644    </const>
    14627     <const name="OnMachineRegistered" value="36">
     14645    <const name="OnMachineRegistered" value="37">
    1462814646      <desc>
    1462914647        <see>IVirtualBoxCallback::onMachineRegistered</see>
    1463014648      </desc>
    1463114649    </const>
    14632     <const name="OnSessionStateChange" value="37">
     14650    <const name="OnSessionStateChange" value="38">
    1463314651      <desc>
    1463414652        <see>IVirtualBoxCallback::onSessionStateChange</see>
    1463514653      </desc>
    1463614654    </const>
    14637     <const name="OnSnapshotTaken" value="38">
     14655    <const name="OnSnapshotTaken" value="39">
    1463814656      <desc>
    1463914657        <see>IVirtualBoxCallback::onSnapshotTaken</see>
    1464014658      </desc>
    1464114659    </const>
    14642     <const name="OnSnapshotDeleted" value="39">
     14660    <const name="OnSnapshotDeleted" value="40">
    1464314661      <desc>
    1464414662        <see>IVirtualBoxCallback::onSnapshotDeleted</see>
    1464514663      </desc>
    1464614664    </const>
    14647     <const name="OnSnapshotChange" value="40">
     14665    <const name="OnSnapshotChange" value="41">
    1464814666      <desc>
    1464914667        <see>IVirtualBoxCallback::onSnapshotChange</see>
     
    1465514673      </desc>
    1465614674    </const>
    14657 
    14658     <const name="Last" value="43">
    14659       <desc>
    14660         Must be last event, used for iterations.
     14675    <!-- Console events -->
     14676    <const name="OnMousePointerShapeChange" value="43">
     14677      <desc>
     14678        <see>IConsoleCallback::onMousePointerShapeChange</see>
     14679      </desc>
     14680    </const>
     14681    <const name="OnMouseCapabilityChange" value="44">
     14682      <desc>
     14683        <see>IConsoleCallback::onMouseCapabilityChange</see>
     14684      </desc>
     14685    </const>
     14686    <const name="OnKeyboardLedsChange" value="45">
     14687      <desc>
     14688        <see>IConsoleCallback::onKeyboardLedsChange</see>
     14689      </desc>
     14690    </const>
     14691    <const name="OnStateChange" value="46">
     14692      <desc>
     14693        <see>IConsoleCallback::onStateChange</see>
     14694      </desc>
     14695    </const>
     14696    <const name="OnAdditionsStateChange" value="47">
     14697      <desc>
     14698        <see>IConsoleCallback::onAdditionsStateChange</see>
     14699      </desc>
     14700    </const>
     14701    <const name="OnNetworkAdapterChange" value="48">
     14702      <desc>
     14703        <see>IConsoleCallback::onNetworkAdapterChange</see>
     14704      </desc>
     14705    </const>
     14706    <const name="OnSerialPortChange" value="49">
     14707      <desc>
     14708        <see>IConsoleCallback::onSerialPortChange</see>
     14709      </desc>
     14710    </const>
     14711    <const name="OnParallelPortChange" value="50">
     14712      <desc>
     14713        <see>IConsoleCallback::onParallelPortChange</see>
     14714      </desc>
     14715    </const>
     14716    <const name="OnStorageControllerChange" value="51">
     14717      <desc>
     14718        <see>IConsoleCallback::onStorageControllerChange</see>
     14719      </desc>
     14720    </const>
     14721    <const name="OnMediumChange" value="52">
     14722      <desc>
     14723        <see>IConsoleCallback::onMediumChange</see>
     14724      </desc>
     14725    </const>
     14726    <const name="OnVRDPServerChange" value="53">
     14727      <desc>
     14728        <see>IConsoleCallback::onVRDPServerChange</see>
     14729      </desc>
     14730    </const>
     14731    <const name="OnUSBControllerChange" value="54">
     14732      <desc>
     14733        <see>IConsoleCallback::onUSBControllerChange</see>
     14734      </desc>
     14735    </const>
     14736    <const name="OnUSBDeviceStateChange" value="55">
     14737      <desc>
     14738        <see>IConsoleCallback::onUSBDeviceStateChange</see>
     14739      </desc>
     14740    </const>
     14741    <const name="OnSharedFolderChange" value="56">
     14742      <desc>
     14743        <see>IConsoleCallback::onSharedFolderChange</see>
     14744      </desc>
     14745    </const>
     14746    <const name="OnRuntimeError" value="57">
     14747      <desc>
     14748        <see>IConsoleCallback::onRuntimeError</see>
     14749      </desc>
     14750    </const>
     14751    <const name="OnCanShowWindow" value="58">
     14752      <desc>
     14753        <see>IConsoleCallback::onCanShowWindow</see>
     14754      </desc>
     14755    </const>
     14756    <const name="OnShowWindow" value="59">
     14757      <desc>
     14758        <see>IConsoleCallback::onShowWindow</see>
     14759      </desc>
     14760    </const>
     14761    <!-- Last event marker -->
     14762    <const name="Last" value="60">
     14763      <desc>
     14764        Must be last event, used for iterations and structures relying on numerical event values.
    1466114765      </desc>
    1466214766    </const>
     
    1498315087  </interface>
    1498415088
    14985    <interface
     15089  <interface
    1498615090     name="ISnapshotChangeEvent" extends="ISnapshotEvent"
    1498715091     uuid="07541941-8079-447a-a33e-47a69c7980db"
     
    1499215096      <see>ISnapshot</see>
    1499315097    </desc>
     15098  </interface>
     15099
     15100  <interface
     15101     name="IMousePointerShapeChangeEvent" extends="IEvent"
     15102     uuid="a6dcf6e8-416b-4181-8c4a-45ec95177aef"
     15103     wsmap="managed" id="OnMousePointerShapeChange"
     15104     >
     15105    <desc>
     15106      Notification when the guest mouse pointer shape has
     15107      changed. The new shape data is given.
     15108    </desc>
     15109
     15110    <attribute name="visible" type="boolean" readonly="yes">
     15111      <desc>
     15112        Flag whether the pointer is visible.
     15113      </desc>
     15114    </attribute>
     15115    <attribute name="alpha" type="boolean" readonly="yes">
     15116      <desc>
     15117        Flag whether the pointer has an alpha channel.
     15118      </desc>
     15119    </attribute>
     15120    <attribute name="xhot" type="unsigned long" readonly="yes">
     15121      <desc>
     15122        The pointer hot spot X coordinate.
     15123      </desc>
     15124    </attribute>
     15125    <attribute name="yhot" type="unsigned long" readonly="yes">
     15126      <desc>
     15127        The pointer hot spot Y coordinate.
     15128      </desc>
     15129    </attribute>
     15130    <attribute name="width" type="unsigned long" readonly="yes">
     15131      <desc>
     15132       Width of the pointer shape in pixels.
     15133      </desc>
     15134    </attribute>
     15135    <attribute name="height" type="unsigned long" readonly="yes">
     15136      <desc>
     15137       Height of the pointer shape in pixels.
     15138      </desc>
     15139    </attribute>
     15140    <attribute name="shape" type="octet" safearray="yes" readonly="yes">
     15141      <desc>
     15142        Shape buffer arrays.
     15143
     15144        The @a shape buffer contains a 1-bpp (bits per pixel) AND mask
     15145        followed by a 32-bpp XOR (color) mask.
     15146
     15147        For pointers without alpha channel the XOR mask pixels are 32
     15148        bit values: (lsb)BGR0(msb). For pointers with alpha channel
     15149        the XOR mask consists of (lsb)BGRA(msb) 32 bit values.
     15150
     15151        An AND mask is used for pointers with alpha channel, so if the
     15152        callback does not support alpha, the pointer could be
     15153        displayed as a normal color pointer.
     15154
     15155        The AND mask is a 1-bpp bitmap with byte aligned scanlines. The
     15156        size of the AND mask therefore is <tt>cbAnd = (width + 7) / 8 *
     15157          height</tt>. The padding bits at the end of each scanline are
     15158        undefined.
     15159
     15160        The XOR mask follows the AND mask on the next 4-byte aligned
     15161        offset: <tt>uint8_t *pXor = pAnd + (cbAnd + 3) &amp; ~3</tt>.
     15162        Bytes in the gap between the AND and the XOR mask are undefined.
     15163        The XOR mask scanlines have no gap between them and the size of
     15164        the XOR mask is: <tt>cXor = width * 4 * height</tt>.
     15165
     15166        <note>
     15167          If @a shape is 0, only the pointer visibility is changed.
     15168        </note>
     15169      </desc>
     15170    </attribute>
     15171  </interface>
     15172
     15173  <interface
     15174     name="IMouseCapabilityChangeEvent" extends="IEvent"
     15175     uuid="d633ad48-820c-4207-b46c-6bd3596640d5"
     15176     wsmap="managed" autogen="VBoxEvent" id="OnMouseCapabilityChange"
     15177     >
     15178    <desc>
     15179      Notification when the mouse capabilities reported by the
     15180      guest have changed. The new capabilities are passed.
     15181    </desc>
     15182    <attribute name="supportsAbsolute" type="boolean" readonly="yes">
     15183      <desc>
     15184        Supports absolute coordinates.
     15185      </desc>
     15186    </attribute>
     15187    <attribute name="supportsRelative" type="boolean" readonly="yes">
     15188      <desc>
     15189        Supports relative coordinates.
     15190      </desc>
     15191    </attribute>
     15192    <attribute name="needsHostCursor" type="boolean" readonly="yes">
     15193      <desc>
     15194        If host cursor is needed.
     15195      </desc>
     15196    </attribute>
    1499415197  </interface>
    1499515198
     
    1502115224  </interface>
    1502215225
     15226  <interface
     15227      name="IVetoEvent" extends="IEvent"
     15228      uuid="9a1a4130-69fe-472f-ac10-c6fa25d75007"
     15229      wsmap="managed"
     15230      >
     15231    <desc>Base abstract interface for veto events.</desc>
     15232
     15233    <method name="addVeto">
     15234      <desc>
     15235        Adds a veto on this event.
     15236      </desc>
     15237      <param name="reason" type="wstring" dir="in">
     15238        <desc>
     15239          Reason for veto.
     15240        </desc>
     15241      </param>
     15242    </method>
     15243
     15244    <method name="isVetoed">
     15245      <desc>
     15246        If this event was vetoed.
     15247      </desc>
     15248      <param name="result" type="boolean" dir="return">
     15249        <desc>
     15250          Reason for veto.
     15251        </desc>
     15252      </param>
     15253    </method>
     15254
     15255    <method name="getVetos">
     15256      <desc>
     15257        Current veto list, if size is 0 - no veto.
     15258      </desc>
     15259      <param name="result" type="wstring" dir="return" safearray="yes">
     15260        <desc>
     15261          Reason for veto.
     15262        </desc>
     15263      </param>
     15264    </method>
     15265
     15266  </interface>
     15267
     15268  <interface
     15269      name="ICanExtraDataChangeEvent" extends="IVetoEvent"
     15270      uuid="245d88bd-800a-40f8-87a6-170d02249a55"
     15271      wsmap="managed" id="OnExtraDataCanChange"
     15272      waitable="true"
     15273      >
     15274    <desc>
     15275      Notification when someone tries to change extra data for
     15276      either the given machine or (if @c null) global extra data.
     15277      This gives the chance to veto against changes.
     15278    </desc>
     15279    <attribute name="machineId" type="uuid" mod="string" readonly="yes">
     15280      <desc>
     15281        ID of the machine this event relates to.
     15282        Null for global extra data changes.
     15283      </desc>
     15284    </attribute>
     15285    <attribute name="key" type="wstring" readonly="yes">
     15286      <desc>
     15287        Extra data key that has changed.
     15288      </desc>
     15289    </attribute>
     15290    <attribute name="value" type="wstring" readonly="yes">
     15291      <desc>
     15292        Extra data value for the given key.
     15293      </desc>
     15294    </attribute>
     15295  </interface>
     15296
     15297  <interface
     15298      name="ICanShowWindowEvent" extends="IVetoEvent"
     15299      uuid="adf292b0-92c9-4a77-9d35-e058b39fe0b9"
     15300      wsmap="managed" id="OnCanShowWindow"
     15301      waitable="true"
     15302      >
     15303    <desc>
     15304      Notification when a call to
     15305      <link to="IMachine::canShowConsoleWindow"/> is made by a
     15306      front-end to check if a subsequent call to
     15307      <link to="IMachine::showConsoleWindow"/> can succeed.
     15308
     15309      The callee should give an answer appropriate to the current
     15310      machine state using event veto. This answer must
     15311      remain valid at least until the next
     15312      <link to="IConsole::state">machine state</link> change.
     15313    </desc>
     15314  </interface>
     15315
    1502315316  <module name="VBoxSVC" context="LocalServer">
    1502415317    <class name="VirtualBox" uuid="B1A7A4F2-47B9-4A1E-82B2-07CCD5323C3F"
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r30479 r30510  
    103103    <xsl:when test="$type='boolean'">
    104104      <xsl:value-of select="'BOOL'" />
     105    </xsl:when>
     106    <xsl:when test="$type='unsigned long'">
     107      <xsl:value-of select="'ULONG'" />
     108    </xsl:when>
     109    <xsl:when test="$type='long'">
     110      <xsl:value-of select="'LONG'" />
    105111    </xsl:when>
    106112    <xsl:otherwise>
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r30324 r30510  
    2222#include "SchemaDefs.h"
    2323#include "VBox/com/array.h"
     24#include "EventImpl.h"
    2425
    2526class Guest;
     
    133134    STDMETHOD(COMGETTER(RemoteDisplayInfo))(IRemoteDisplayInfo **aRemoteDisplayInfo);
    134135    STDMETHOD(COMGETTER(SharedFolders))(ComSafeArrayOut(ISharedFolder *, aSharedFolders));
     136    STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
    135137
    136138    // IConsole methods
     
    610612    const ComObjPtr<MachineDebugger> mDebugger;
    611613    const ComObjPtr<RemoteDisplayInfo> mRemoteDisplayInfo;
     614    const ComObjPtr<EventSource> mEventSource;
    612615
    613616    USBDeviceList mUSBDevices;
     
    737740    ComEventsHelper                     mComEvHelper;
    738741#endif
    739    
     742
    740743    friend struct VMTask;
    741744};
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