VirtualBox

Changeset 29545 in vbox


Ignore:
Timestamp:
May 17, 2010 2:04:53 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61686
Message:

FE/Qt4: Qt'ify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r29542 r29545  
    5555public:
    5656
    57     UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, ComSafeArrayIn(BYTE,pShape))
     57    UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, const QVector<uint8_t>& shape)
    5858        : QEvent((QEvent::Type)UIConsoleEventType_MousePointerShapeChange)
    59         , m_bIsVisible(bIsVisible), m_bIsAlpha(bIsAlpha), m_uXHot(uXHot), m_uYHot(uYHot), m_uWidth(uWidth), m_uHeight(uHeight)
    60     {
    61         com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
    62         size_t cbShapeSize = aShape.size();       
    63         if (cbShapeSize > 0)
    64         {
    65             m_shape.resize(cbShapeSize);
    66             ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize);
    67         }
     59        , m_bIsVisible(bIsVisible), m_bIsAlpha(bIsAlpha), m_uXHot(uXHot), m_uYHot(uYHot), m_uWidth(uWidth), m_uHeight(uHeight), m_shape(shape)
     60    {
    6861    }
    6962
     
    7871    uint width() const { return m_uWidth; }
    7972    uint height() const { return m_uHeight; }
    80     const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.raw() : NULL; }
     73    const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.data() : NULL; }
    8174
    8275private:
     
    8477    bool m_bIsVisible, m_bIsAlpha;
    8578    uint m_uXHot, m_uYHot, m_uWidth, m_uHeight;
    86     com::SafeArray <uint8_t> m_shape;
     79    QVector<uint8_t> m_shape;
    8780};
    8881
     
    386379    VBOX_SCRIPTABLE_DISPATCH_IMPL(IConsoleCallback)
    387380
    388     STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE,pShape))
    389     {
    390         QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, ComSafeArrayInArg(pShape)));
     381    STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE, pShape))
     382    {
     383        com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape));
     384        QVector<uint8_t> shapeVec(static_cast<int>(aShape.size()));
     385        for (int i = 0; i < shapeVec.size(); ++i)
     386            shapeVec[i] = aShape[i];
     387        QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, shapeVec));
    391388        return S_OK;
    392389    }
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