Changeset 470 in vbox
- Timestamp:
- Jan 31, 2007 4:14:04 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18068
- Location:
- trunk/src/VBox
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
r143 r470 258 258 * @param address Pointer to result variable. 259 259 */ 260 STDMETHODIMP VBoxSDLFB::COMGETTER(Address)( ULONG*address)260 STDMETHODIMP VBoxSDLFB::COMGETTER(Address)(BYTE **address) 261 261 { 262 262 LogFlow(("VBoxSDLFB::GetAddress\n")); … … 266 266 if (mSurfVRAM) 267 267 { 268 *address = ( uintptr_t)mSurfVRAM->pixels;268 *address = (BYTE *) mSurfVRAM->pixels; 269 269 } 270 270 else … … 424 424 * continuing with display updates. 425 425 */ 426 STDMETHODIMP VBoxSDLFB::RequestResize(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h,427 BOOL *finished)426 STDMETHODIMP VBoxSDLFB::RequestResize(FramebufferPixelFormat_T pixelFormat, BYTE *vram, 427 ULONG lineSize, ULONG w, ULONG h, BOOL *finished) 428 428 { 429 429 LogFlow(("VBoxSDLFB::RequestResize: w = %d, h = %d, pixelFormat: %d, vram = %p, lineSize = %d\n", … … 443 443 mGuestYRes = h; 444 444 mPixelFormat = pixelFormat; 445 mPtrVRAM = (void *)vram;445 mPtrVRAM = vram; 446 446 mLineSize = lineSize; 447 447 -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h
r143 r470 89 89 STDMETHOD(Lock)(); 90 90 STDMETHOD(Unlock)(); 91 STDMETHOD(COMGETTER(Address))( ULONG*address);91 STDMETHOD(COMGETTER(Address))(BYTE **address); 92 92 STDMETHOD(COMGETTER(ColorDepth))(ULONG *colorDepth); 93 93 STDMETHOD(COMGETTER(LineSize))(ULONG *lineSize); … … 98 98 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, 99 99 ULONG w, ULONG h, BOOL *finished); 100 STDMETHOD(RequestResize)(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h,101 BOOL *finished);100 STDMETHOD(RequestResize)(FramebufferPixelFormat_T pixelFormat, BYTE *vram, 101 ULONG lineSize, ULONG w, ULONG h, BOOL *finished); 102 102 STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation, BOOL *supported); 103 103 STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported); … … 179 179 SDL_Surface *mSurfVRAM; 180 180 181 void*mPtrVRAM;181 BYTE *mPtrVRAM; 182 182 ULONG mLineSize; 183 183 FramebufferPixelFormat_T mPixelFormat; -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r458 r470 387 387 388 388 STDMETHOD(OnMousePointerShapeChange) (BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 389 ULONG width, ULONG height, ULONGshape)389 ULONG width, ULONG height, BYTE *shape) 390 390 { 391 391 PointerShapeChangeData *data; 392 392 data = new PointerShapeChangeData (visible, alpha, xHot, yHot, width, height, 393 (const uint8_t *)shape);393 shape); 394 394 Assert (data); 395 395 if (!data) -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r382 r470 73 73 { 74 74 public: 75 VBoxResizeEvent (FramebufferPixelFormat_T f, void*v, unsigned l, int w, int h) :75 VBoxResizeEvent (FramebufferPixelFormat_T f, uchar *v, unsigned l, int w, int h) : 76 76 QEvent ((QEvent::Type) VBoxDefs::ResizeEventType), fmt (f), vr (v), lsz (l), wdt (w), hgt (h) {} 77 77 FramebufferPixelFormat_T pixelFormat() { return fmt; } 78 void*vram() { return vr; }78 uchar *vram() { return vr; } 79 79 unsigned lineSize() { return lsz; } 80 80 int width() { return wdt; } … … 82 82 private: 83 83 FramebufferPixelFormat_T fmt; 84 void*vr;84 uchar *vr; 85 85 unsigned lsz; 86 86 int wdt; … … 204 204 205 205 // IFramebuffer COM methods 206 STDMETHOD(COMGETTER(Address)) ( ULONG*aAddress);206 STDMETHOD(COMGETTER(Address)) (BYTE **aAddress); 207 207 STDMETHOD(COMGETTER(Width)) (ULONG *aWidth); 208 208 STDMETHOD(COMGETTER(Height)) (ULONG *aHeight); … … 217 217 218 218 STDMETHOD(RequestResize) (FramebufferPixelFormat_T aPixelFormat, 219 ULONGaVRAM, ULONG aLineSize,219 BYTE *aVRAM, ULONG aLineSize, 220 220 ULONG aWidth, ULONG aHeight, 221 221 BOOL *aFinished); … … 362 362 SDL_Surface *mSurfVRAM; 363 363 364 void*mPtrVRAM;364 uchar *mPtrVRAM; 365 365 ULONG mLineSize; 366 366 FramebufferPixelFormat_T mPixelFormat; … … 397 397 void releaseObjects(); 398 398 399 void setupSurface (FramebufferPixelFormat_T pixelFormat, void*pvVRAM, ULONG lineSize, ULONG w, ULONG h);400 void recreateSurface (FramebufferPixelFormat_T pixelFormat, void*pvVRAM, ULONG lineSize, ULONG w, ULONG h);399 void setupSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h); 400 void recreateSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h); 401 401 void deleteSurface (); 402 402 void drawRect (ULONG x, ULONG y, ULONG w, ULONG h); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r382 r470 258 258 ULONG xhot, ULONG yhot, 259 259 ULONG width, ULONG height, 260 ULONGshape)260 BYTE *shape) 261 261 { 262 262 QApplication::postEvent ( 263 263 view, new MousePointerChangeEvent (visible, alpha, xhot, yhot, 264 264 width, height, 265 (const uchar*)shape)265 shape) 266 266 ); 267 267 return S_OK; … … 1785 1785 QImage shot = QImage (fb->width(), fb->height(), 32, 0); 1786 1786 CDisplay dsp = cconsole.GetDisplay(); 1787 dsp.TakeScreenShot ((uintptr_t) shot.bits(), 1788 shot.width(), shot.height()); 1787 dsp.TakeScreenShot (shot.bits(), shot.width(), shot.height()); 1789 1788 /* 1790 1789 * TakeScreenShot() may fail if, e.g. the Paused notification -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBDDRAW.cpp
r382 r470 279 279 * and VBoxDDRAWFrameBuffer::mPixelFormat to format of the created surface. 280 280 */ 281 void VBoxDDRAWFrameBuffer::setupSurface (FramebufferPixelFormat_T pixelFormat, void*pvVRAM, ULONG lineSize, ULONG w, ULONG h)281 void VBoxDDRAWFrameBuffer::setupSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h) 282 282 { 283 283 /* Check requested pixel format. */ … … 315 315 * the requested format is supported and the surface was successfully created. 316 316 */ 317 void VBoxDDRAWFrameBuffer::recreateSurface (FramebufferPixelFormat_T pixelFormat, void*pvVRAM, ULONG lineSize, ULONG w, ULONG h)317 void VBoxDDRAWFrameBuffer::recreateSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h) 318 318 { 319 319 HRESULT rc; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
r382 r470 59 59 // Just forwarders to relevant class methods. 60 60 61 STDMETHODIMP VBoxFrameBuffer::COMGETTER(Address) ( ULONG*aAddress)61 STDMETHODIMP VBoxFrameBuffer::COMGETTER(Address) (BYTE **aAddress) 62 62 { 63 63 if (!aAddress) 64 64 return E_POINTER; 65 *aAddress = (uintptr_t)address();65 *aAddress = address(); 66 66 return S_OK; 67 67 } … … 140 140 /** @note This method is called on EMT from under this object's lock */ 141 141 STDMETHODIMP VBoxFrameBuffer::RequestResize (FramebufferPixelFormat_T aPixelFormat, 142 ULONGaVRAM, ULONG aLineSize,142 BYTE *aVRAM, ULONG aLineSize, 143 143 ULONG aWidth, ULONG aHeight, 144 144 BOOL *aFinished) 145 145 { 146 146 QApplication::postEvent (mView, 147 new VBoxResizeEvent (aPixelFormat, (void *)aVRAM,147 new VBoxResizeEvent (aPixelFormat, aVRAM, 148 148 aLineSize, aWidth, aHeight)); 149 149 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r447 r470 3253 3253 CallbackList::iterator it = mCallbacks.begin(); 3254 3254 while (it != mCallbacks.end()) 3255 (*it++)->OnMousePointerShapeChange(fVisible, fAlpha, xHot, yHot, width, height, (ULONG)pShape); 3255 (*it++)->OnMousePointerShapeChange (fVisible, fAlpha, xHot, yHot, 3256 width, height, (BYTE *) pShape); 3256 3257 } 3257 3258 -
trunk/src/VBox/Main/DisplayImpl.cpp
r431 r470 197 197 RTSemEventMultiReset(mResizeSem); 198 198 199 mFramebuffer->RequestResize (pixelFormat, ( ULONG)pvVRAM, cbLine, w, h, &finished);199 mFramebuffer->RequestResize (pixelFormat, (BYTE *) pvVRAM, cbLine, w, h, &finished); 200 200 201 201 if (!finished) … … 270 270 271 271 /* Framebuffer successfully set the requested format. */ 272 ULONGaddress;272 BYTE *address; 273 273 mFramebuffer->COMGETTER(Address) (&address); 274 274 … … 282 282 uint32_t cbBuffer = cbLine * h; 283 283 284 int rc = mpDrv->pUpPort->pfnSetupVRAM (mpDrv->pUpPort, (void *)address, cbBuffer);284 int rc = mpDrv->pUpPort->pfnSetupVRAM (mpDrv->pUpPort, address, cbBuffer); 285 285 286 286 if (VBOX_FAILURE(rc)) … … 1214 1214 } 1215 1215 1216 STDMETHODIMP Display::LockFramebuffer ( ULONG*address)1216 STDMETHODIMP Display::LockFramebuffer (BYTE **address) 1217 1217 { 1218 1218 if (!address) … … 1229 1229 mFramebuffer->Lock(); 1230 1230 mFramebufferOpened = true; 1231 *address = (ULONG)mpDrv->Connector.pu8Data;1231 *address = mpDrv->Connector.pu8Data; 1232 1232 return S_OK; 1233 1233 } … … 1324 1324 } 1325 1325 1326 /** 1327 * Takes a screen shot of the requested size and copies it to the buffer 1328 * allocated by the caller. The screen shot is always a 32-bpp image, so the 1329 * size of the buffer must be at least (((width * 32 + 31) / 32) * 4) * height 1330 * (i.e. dword-aligned). If the requested screen shot dimentions differ from 1331 * the actual VM display size then the screen shot image is stretched and/or 1332 * shrunk accordingly. 1333 * 1334 * @returns COM status code 1335 * @param address the address of the buffer allocated by the caller 1336 * @param width the width of the screenshot to take 1337 * @param height the height of the screenshot to take 1338 */ 1339 STDMETHODIMP Display::TakeScreenShot (ULONG address, ULONG width, ULONG height) 1326 STDMETHODIMP Display::TakeScreenShot (BYTE *address, ULONG width, ULONG height) 1340 1327 { 1341 1328 /// @todo (r=dmik) this function may take too long to complete if the VM … … 1380 1367 rcVBox = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT, 1381 1368 (PFNRT)mpDrv->pUpPort->pfnSnapshot, 6, mpDrv->pUpPort, 1382 (void *)address, cbData, NULL, NULL, NULL);1369 address, cbData, NULL, NULL, NULL); 1383 1370 if (VBOX_SUCCESS(rcVBox)) 1384 1371 { … … 1406 1393 } 1407 1394 1408 /** 1409 * Draws an image of the specified size from the given buffer to the given 1410 * point on the VM display. The image is assumed to have a 32-bit depth, so the 1411 * size of one scanline must be ((width * 32 + 31) / 32) * 4), i.e. 1412 * dword-aligned. The total image size in the buffer is height * scanline size. 1413 * 1414 * @returns COM status code 1415 * @param address the address of the buffer containing the image 1416 * @param x the x coordinate on the VM display to place the image to 1417 * @param y the y coordinate on the VM display to place the image to 1418 * @param width the width of the image in the buffer 1419 * @param height the height of the image in the buffer 1420 */ 1421 STDMETHODIMP Display::DrawToScreen (ULONG address, ULONG x, ULONG y, 1395 STDMETHODIMP Display::DrawToScreen (BYTE *address, ULONG x, ULONG y, 1422 1396 ULONG width, ULONG height) 1423 1397 { … … 1431 1405 LogFlowFunc (("address=%p, x=%d, y=%d, width=%d, height=%d\n", 1432 1406 address, x, y, width, height)); 1407 1408 if (!address) 1409 return E_POINTER; 1410 if (!width || !height) 1411 return E_INVALIDARG; 1433 1412 1434 1413 AutoLock lock(this); … … 1447 1426 int rcVBox = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT, 1448 1427 (PFNRT)mpDrv->pUpPort->pfnDisplayBlt, 6, mpDrv->pUpPort, 1449 (void *)address, x, y, width, height);1428 address, x, y, width, height); 1450 1429 if (VBOX_SUCCESS(rcVBox)) 1451 1430 { … … 1617 1596 { 1618 1597 HRESULT rc; 1619 ULONGaddress = 0;1598 BYTE *address = 0; 1620 1599 rc = mFramebuffer->COMGETTER(Address) (&address); 1621 1600 AssertComRC (rc); … … 1640 1619 */ 1641 1620 if (aCheckParams && 1642 (mLastAddress != (uint8_t *)address ||1621 (mLastAddress != address || 1643 1622 mLastLineSize != lineSize || 1644 1623 mLastColorDepth != colorDepth || -
trunk/src/VBox/Main/FramebufferImpl.cpp
r1 r470 56 56 ///////////////////////////////////////////////////////////////////////////// 57 57 58 STDMETHODIMP InternalFramebuffer::COMGETTER(Address) ( ULONG*address)58 STDMETHODIMP InternalFramebuffer::COMGETTER(Address) (BYTE **address) 59 59 { 60 60 if (!address) 61 61 return E_POINTER; 62 *address = (ULONG)mData;62 *address = mData; 63 63 return S_OK; 64 64 } … … 148 148 } 149 149 150 STDMETHODIMP InternalFramebuffer::RequestResize(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h, 151 BOOL *finished) 150 STDMETHODIMP 151 InternalFramebuffer::RequestResize(FramebufferPixelFormat_T pixelFormat, BYTE *vram, 152 ULONG lineSize, ULONG w, ULONG h, 153 BOOL *finished) 152 154 { 153 155 if (!finished) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r444 r470 2365 2365 </desc> 2366 2366 </param> 2367 <param name="shape" type=" unsigned long" dir="in">2367 <param name="shape" type="octet" mod="ptr" dir="in"> 2368 2368 <desc> 2369 2369 Address of the shape buffer. … … 5390 5390 uuid="4481F27F-5C79-48d9-86C1-A2EC6747034D" 5391 5391 > 5392 <attribute name="address" type=" unsigned long" readonly="yes">5392 <attribute name="address" type="octet" mod="ptr" readonly="yes"> 5393 5393 <desc>Address of the start byte of the framebuffer.</desc> 5394 5394 </attribute> … … 5510 5510 <desc>Pixel format of the surface (BPP and layout)</desc> 5511 5511 </param> 5512 <param name="vram" type=" unsigned long" dir="in">5512 <param name="vram" type="octet" mod="ptr" dir="in"> 5513 5513 <desc>Pointer to the guest VRAM (NULL for non linear modes)</desc> 5514 5514 </param> … … 5636 5636 <attribute name="colorDepth" type="unsigned long" readonly="yes"> 5637 5637 <desc> 5638 Current guest display color depth. Note that this m ight5639 be differentfrom <link to="IFramebuffer::colorDepth">IFramebuffer::colorDepth</link>.5638 Current guest display color depth. Note that this may differ 5639 from <link to="IFramebuffer::colorDepth">IFramebuffer::colorDepth</link>. 5640 5640 </desc> 5641 5641 </attribute> … … 5652 5652 Requests access to the internal framebuffer. 5653 5653 </desc> 5654 <param name="address" type=" unsigned long" dir="return"/>5654 <param name="address" type="octet" mod="ptr" dir="return"/> 5655 5655 </method> 5656 5656 … … 5689 5689 32-bpp buffer allocated by the caller. 5690 5690 </desc> 5691 <param name="address" type=" unsigned long" dir="in"/>5691 <param name="address" type="octet" mod="ptr" dir="in"/> 5692 5692 <param name="width" type="unsigned long" dir="in"/> 5693 5693 <param name="height" type="unsigned long" dir="in"/> … … 5699 5699 to the given point on the VM display. 5700 5700 </desc> 5701 <param name="address" type=" unsigned long" dir="in"/>5701 <param name="address" type="octet" mod="ptr" dir="in"/> 5702 5702 <param name="x" type="unsigned long" dir="in"/> 5703 5703 <param name="y" type="unsigned long" dir="in"/> -
trunk/src/VBox/Main/include/DisplayImpl.h
r255 r470 79 79 #endif /* VBOX_VRDP */ 80 80 81 /* IConsoleCallback methods */ 82 STDMETHOD(OnMousePointerShapeChange)(BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, ULONG width, ULONG height, ULONG shape) 81 // IConsoleCallback methods 82 STDMETHOD(OnMousePointerShapeChange)(BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 83 ULONG width, ULONG height, BYTE *shape) 83 84 { 84 85 return S_OK; … … 114 115 // IDisplay methods 115 116 STDMETHOD(SetupInternalFramebuffer)(ULONG depth); 116 STDMETHOD(LockFramebuffer)( ULONG*address);117 STDMETHOD(LockFramebuffer)(BYTE **address); 117 118 STDMETHOD(UnlockFramebuffer)(); 118 119 STDMETHOD(RegisterExternalFramebuffer)(IFramebuffer *frameBuf); 119 120 STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG colorDepth); 120 STDMETHOD(TakeScreenShot)( ULONGaddress, ULONG width, ULONG height);121 STDMETHOD(DrawToScreen)( ULONGaddress, ULONG x, ULONG y, ULONG width, ULONG height);121 STDMETHOD(TakeScreenShot)(BYTE *address, ULONG width, ULONG height); 122 STDMETHOD(DrawToScreen)(BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height); 122 123 STDMETHOD(InvalidateAndUpdate)(); 123 124 STDMETHOD(ResizeCompleted)(); -
trunk/src/VBox/Main/include/FramebufferImpl.h
r1 r470 48 48 49 49 // IFramebuffer properties 50 STDMETHOD(COMGETTER(Address)) ( ULONG*address);50 STDMETHOD(COMGETTER(Address)) (BYTE **address); 51 51 STDMETHOD(COMGETTER(Width)) (ULONG *width); 52 52 STDMETHOD(COMGETTER(Height)) (ULONG *height); … … 63 63 ULONG w, ULONG h, 64 64 BOOL *finished); 65 STDMETHOD(RequestResize)(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h, 65 STDMETHOD(RequestResize)(FramebufferPixelFormat_T pixelFormat, BYTE *vram, 66 ULONG lineSize, ULONG w, ULONG h, 66 67 BOOL *finished); 67 68 STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation,
Note:
See TracChangeset
for help on using the changeset viewer.