Changeset 29545 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 17, 2010 2:04:53 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61686
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r29542 r29545 55 55 public: 56 56 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) 58 58 : 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 { 68 61 } 69 62 … … 78 71 uint width() const { return m_uWidth; } 79 72 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; } 81 74 82 75 private: … … 84 77 bool m_bIsVisible, m_bIsAlpha; 85 78 uint m_uXHot, m_uYHot, m_uWidth, m_uHeight; 86 com::SafeArray<uint8_t> m_shape;79 QVector<uint8_t> m_shape; 87 80 }; 88 81 … … 386 379 VBOX_SCRIPTABLE_DISPATCH_IMPL(IConsoleCallback) 387 380 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)); 391 388 return S_OK; 392 389 }
Note:
See TracChangeset
for help on using the changeset viewer.