Changeset 29518 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 17, 2010 10:06:22 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61658
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r28960 r29518 305 305 306 306 STDMETHOD(OnMousePointerShapeChange)(BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 307 ULONG width, ULONG height, BYTE *shape)307 ULONG width, ULONG height, ComSafeArrayIn(BYTE,shape)) 308 308 { 309 309 return VBOX_E_DONT_CALL_AGAIN; … … 1243 1243 } 1244 1244 #endif /* !VBOX_WITH_HARDENING */ 1245 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r29431 r29518 100 100 { 101 101 PointerShapeChangeData(BOOL aVisible, BOOL aAlpha, ULONG aXHot, ULONG aYHot, 102 ULONG aWidth, ULONG aHeight, const uint8_t *aShape)102 ULONG aWidth, ULONG aHeight, ComSafeArrayIn(BYTE,pShape)) 103 103 : visible(aVisible), alpha(aAlpha), xHot(aXHot), yHot(aYHot), 104 width(aWidth), height(aHeight) , shape(NULL)104 width(aWidth), height(aHeight) 105 105 { 106 106 // make a copy of the shape 107 if (aShape) 108 { 109 uint32_t shapeSize = ((((aWidth + 7) / 8) * aHeight + 3) & ~3) + aWidth * 4 * aHeight; 110 shape = new uint8_t [shapeSize]; 111 if (shape) 112 memcpy((void *)shape, (void *)aShape, shapeSize); 113 } 107 com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape)); 108 size_t cbShapeSize = aShape.size(); 109 shape.resize(cbShapeSize); 110 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 114 111 } 115 112 116 113 ~PointerShapeChangeData() 117 114 { 118 if (shape) delete[] shape;119 115 } 120 116 … … 125 121 const ULONG width; 126 122 const ULONG height; 127 co nst uint8_t *shape;123 com::SafeArray<BYTE> shape; 128 124 }; 129 125 … … 401 397 402 398 STDMETHOD(OnMousePointerShapeChange)(BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 403 ULONG width, ULONG height, BYTE *shape)399 ULONG width, ULONG height, ComSafeArrayIn(BYTE, shape)) 404 400 { 405 401 PointerShapeChangeData *data; 406 402 data = new PointerShapeChangeData(visible, alpha, xHot, yHot, width, height, 407 shape);403 ComSafeArrayInArg(shape)); 408 404 Assert(data); 409 405 if (!data) … … 4430 4426 return; 4431 4427 4432 if (data->shape )4428 if (data->shape.size() > 0) 4433 4429 { 4434 4430 bool ok = false; … … 4437 4433 uint32_t srcShapePtrScan = data->width * 4; 4438 4434 4439 const uint8_t *srcAndMaskPtr = data->shape; 4440 const uint8_t *srcShapePtr = data->shape + ((andMaskSize + 3) & ~3); 4435 const uint8_t* shape = data->shape.raw(); 4436 const uint8_t *srcAndMaskPtr = shape; 4437 const uint8_t *srcShapePtr = shape + ((andMaskSize + 3) & ~3); 4441 4438 4442 4439 #if 0 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r28960 r29518 30 30 #include "VBoxGlobal.h" 31 31 #include "VBoxProblemReporter.h" 32 #include "VBox/com/array.h" 32 33 33 34 #ifdef Q_WS_PM … … 209 210 MousePointerChangeEvent (bool visible, bool alpha, uint xhot, uint yhot, 210 211 uint width, uint height, 211 const uchar *shape) :212 ComSafeArrayIn(BYTE,pShape)) : 212 213 QEvent ((QEvent::Type) VBoxDefs::MousePointerChangeEventType), 213 vis (visible), alph (alpha), xh (xhot), yh (yhot), w (width), h (height), 214 data (NULL) 215 { 216 // make a copy of shape 217 uint dataSize = ((((width + 7) / 8 * height) + 3) & ~3) + width * 4 * height; 218 219 if (shape) { 220 data = new uchar [dataSize]; 221 memcpy ((void *) data, (void *) shape, dataSize); 222 } 214 vis (visible), alph (alpha), xh (xhot), yh (yhot), w (width), h (height) 215 { 216 com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape)); 217 size_t cbShapeSize = aShape.size(); 218 shape.resize(cbShapeSize); 219 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 223 220 } 224 221 ~MousePointerChangeEvent() 225 222 { 226 if (data) delete[] data;227 223 } 228 224 bool isVisible() const { return vis; } … … 232 228 uint width() const { return w; } 233 229 uint height() const { return h; } 234 const uchar *shapeData() const { return data; }230 const uchar *shapeData() const { return shape.raw(); } 235 231 private: 236 232 bool vis, alph; 237 233 uint xh, yh, w, h; 238 co nst uchar *data;234 com::SafeArray <uint8_t> shape; 239 235 }; 240 236 … … 423 419 ULONG xhot, ULONG yhot, 424 420 ULONG width, ULONG height, 425 BYTE *shape)421 ComSafeArrayIn(BYTE,shape)) 426 422 { 427 423 QApplication::postEvent (mView, 428 424 new MousePointerChangeEvent (visible, alpha, 429 425 xhot, yhot, 430 width, height, shape));426 width, height, ComSafeArrayInArg(shape))); 431 427 return S_OK; 432 428 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r29485 r29518 55 55 public: 56 56 57 UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, const uchar *pShape)57 UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, ComSafeArrayIn(BYTE,pShape)) 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), m_pData(0) 60 { 61 uint dataSize = ((((m_uWidth + 7) / 8 * m_uHeight) + 3) & ~3) + m_uWidth * 4 * m_uHeight; 62 if (pShape) 63 { 64 m_pData = new uchar[dataSize]; 65 memcpy((void*)m_pData, (void*)pShape, dataSize); 66 } 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 m_shape.resize(cbShapeSize); 64 ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize); 67 65 } 68 66 69 67 virtual ~UIMousePointerShapeChangeEvent() 70 68 { 71 if (m_pData) delete[] m_pData;72 69 } 73 70 … … 78 75 uint width() const { return m_uWidth; } 79 76 uint height() const { return m_uHeight; } 80 const uchar *shapeData() const { return m_ pData; }77 const uchar *shapeData() const { return m_shape.raw(); } 81 78 82 79 private: … … 84 81 bool m_bIsVisible, m_bIsAlpha; 85 82 uint m_uXHot, m_uYHot, m_uWidth, m_uHeight; 86 co nst uchar *m_pData;83 com::SafeArray <uint8_t> m_shape; 87 84 }; 88 85 … … 386 383 VBOX_SCRIPTABLE_DISPATCH_IMPL(IConsoleCallback) 387 384 388 STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, BYTE *pShape)389 { 390 QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, pShape));385 STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE,pShape)) 386 { 387 QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, ComSafeArrayInArg(pShape))); 391 388 return S_OK; 392 389 }
Note:
See TracChangeset
for help on using the changeset viewer.