VirtualBox

Changeset 30564 in vbox for trunk/src


Ignore:
Timestamp:
Jul 1, 2010 4:54:16 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63277
Message:

Main: safearray event attributes work

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r30533 r30564  
    432432
    433433def monitorSource(ctx, es, active, dur):
    434     def handleEventImpl(ev):         
    435          print "got event: %s" %(str(ev.type))
     434    def handleEventImpl(ev):
     435         type = ev.type
     436         print "got event: %s %s" %(str(ev.type), asEnumElem(ctx, 'VBoxEventType', type))
    436437         if ev.type == ctx['global'].constants.VBoxEventType_OnMachineStateChange:
    437438             scev = ctx['global'].queryInterface(ev, 'IMachineStateChangeEvent')
    438439             if scev:
    439440                 print "state event: mach=%s state=%s" %(scev.machineId, scev.state)
     441         elif  type == ctx['global'].constants.VBoxEventType_OnMousePointerShapeChange:
     442             psev = ctx['global'].queryInterface(ev, 'IMousePointerShapeChangeEvent')
     443             if psev:
     444                 shape = ctx['global'].getArray(psev, 'shape')
     445                 print "pointer shape event: w=%d h=%d shape len=%d" %(psev.width, psev.height, len(shape))
    440446
    441447    class EventListener:
     
    450456            traceback.print_exc()
    451457            pass
    452  
     458
    453459    if active:
    454460        listener = ctx['global'].createListener(EventListener)
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r30553 r30564  
    50285028        }
    50295029#if 1
    5030         evDesc.init(mEventSource, VBoxEventType_OnShowWindow);
     5030        evDesc.init(mEventSource, VBoxEventType_OnShowWindow, UINT64_C(0));
    50315031        ComPtr<IEvent> aEvent;
    50325032        evDesc.getEvent(aEvent.asOutParam());
    50335033        ComPtr<IShowWindowEvent> aShowEvent = aEvent;
    5034         if (aShowEvent)
    5035             aShowEvent->COMSETTER(WinId)(0);
    5036        
     5034
    50375035        BOOL fDelivered = evDesc.fire(10000); /* Wait up to 10 secs for delivery */
    50385036        Assert(fDelivered);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r30553 r30564  
    1531315313    </attribute>
    1531415314  </interface>
    15315  
     15315
    1531615316  <interface
    1531715317     name="IStorageControllerChangeEvent" extends="IEvent"
     
    1534215342    </attribute>
    1534315343  </interface>
    15344  
     15344
    1534515345   <interface
    1534615346     name="ICPUChangeEvent" extends="IEvent"
     
    1553715537    </attribute>
    1553815538  </interface>
    15539  
     15539
    1554015540  <interface
    1554115541      name="IExtraDataChangeEvent" extends="IEvent"
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r30553 r30564  
    177177  <xsl:choose>
    178178    <xsl:when test="$safearray='yes'">
    179       <!-- @todo: setter missing -->
     179      <xsl:variable name="elemtype">
     180        <xsl:call-template name="typeIdl2Back">
     181          <xsl:with-param name="type" select="@type" />
     182          <xsl:with-param name="safearray" select="''" />
     183          <xsl:with-param name="dir" select="'in'" />
     184        </xsl:call-template>
     185      </xsl:variable>
     186      <xsl:value-of select="concat('         SafeArray&lt;', $elemtype, '&gt; aArr(ComSafeArrayInArg(',$param,'));&#10;')"/>
     187      <xsl:value-of select="concat('         ',$member, '.initFrom(aArr);&#10;')"/>
    180188    </xsl:when>
    181189    <xsl:otherwise>
     
    192200  <xsl:choose>
    193201    <xsl:when test="$safearray='yes'">
    194       <xsl:value-of select="concat('         ', $member, '.cloneTo(ComSafeArrayOutArg (', $param, '));&#10;')"/>
     202      <xsl:value-of select="concat('         ', $member, '.detachTo(ComSafeArrayOutArg (', $param, '));&#10;')"/>
    195203    </xsl:when>
    196204    <xsl:otherwise>
     
    252260    </xsl:variable>
    253261
    254     <!-- no safearrays params yet -->
    255     <xsl:if test="not(@safearray)">
    256       <xsl:value-of select="concat('              ',$aTypeName, ' = va_arg(args, ',$aType,');&#10;')"/>
    257       <xsl:value-of select="concat('              ',$obj, '->set_', @name, '(',$aName, ');&#10;')"/>
    258     </xsl:if>
     262    <xsl:choose>
     263      <xsl:when test="@safearray='yes'">
     264         <xsl:variable name="elemtype">
     265           <xsl:call-template name="typeIdl2Back">
     266             <xsl:with-param name="type" select="@type" />
     267             <xsl:with-param name="safearray" select="''" />
     268             <xsl:with-param name="dir" select="'in'" />
     269           </xsl:call-template>
     270         </xsl:variable>
     271         <xsl:value-of select="       '#ifdef RT_OS_WINDOWS&#10;'"/>
     272         <xsl:value-of select="       '              SAFEARRAY **    aPtr = va_arg(args, SAFEARRAY **);&#10;'"/>
     273         <xsl:value-of select="concat('              com::SafeArray&lt;', $elemtype,'&gt;   aArr(aPtr);&#10;')"/>
     274         <xsl:value-of select="       '#else&#10;'"/>
     275         <xsl:value-of select="       '              PRUint32 aArrSize = va_arg(args, PRUint32);&#10;'"/>
     276         <xsl:value-of select="       '              void*    aPtr = va_arg(args, void*);&#10;'"/>
     277         <xsl:value-of select="concat('              com::SafeArray&lt;', $elemtype,'&gt;   aArr(aArrSize, (', $elemtype,'*)aPtr);&#10;')"/>
     278         <xsl:value-of select="       '#endif&#10;'"/>
     279         <xsl:value-of select="concat('              ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr));&#10;')"/>
     280      </xsl:when>
     281      <xsl:otherwise>
     282        <xsl:value-of select="concat('              ',$aTypeName, ' = va_arg(args, ',$aType,');&#10;')"/>
     283        <xsl:value-of select="concat('              ',$obj, '->set_', @name, '(',$aName, ');&#10;')"/>
     284      </xsl:otherwise>
     285    </xsl:choose>
    259286  </xsl:for-each>
    260287</xsl:template>
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