VirtualBox

Changeset 470 in vbox


Ignore:
Timestamp:
Jan 31, 2007 4:14:04 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18068
Message:

Main/Frontends: Changed all interface attributes and method parameters that used to use ULONG to pass pointers around; they now use BYTE * for this purpose (should fix problems for 64-bit targets).

Location:
trunk/src/VBox
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r143 r470  
    258258 * @param   address Pointer to result variable.
    259259 */
    260 STDMETHODIMP VBoxSDLFB::COMGETTER(Address)(ULONG *address)
     260STDMETHODIMP VBoxSDLFB::COMGETTER(Address)(BYTE **address)
    261261{
    262262    LogFlow(("VBoxSDLFB::GetAddress\n"));
     
    266266    if (mSurfVRAM)
    267267    {
    268         *address = (uintptr_t)mSurfVRAM->pixels;
     268        *address = (BYTE *) mSurfVRAM->pixels;
    269269    }
    270270    else
     
    424424 *                      continuing with display updates.
    425425 */
    426 STDMETHODIMP VBoxSDLFB::RequestResize(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h,
    427                                       BOOL *finished)
     426STDMETHODIMP VBoxSDLFB::RequestResize(FramebufferPixelFormat_T pixelFormat, BYTE *vram,
     427                                      ULONG lineSize, ULONG w, ULONG h, BOOL *finished)
    428428{
    429429    LogFlow(("VBoxSDLFB::RequestResize: w = %d, h = %d, pixelFormat: %d, vram = %p, lineSize = %d\n",
     
    443443    mGuestYRes = h;
    444444    mPixelFormat = pixelFormat;
    445     mPtrVRAM = (void *)vram;
     445    mPtrVRAM = vram;
    446446    mLineSize = lineSize;
    447447
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h

    r143 r470  
    8989    STDMETHOD(Lock)();
    9090    STDMETHOD(Unlock)();
    91     STDMETHOD(COMGETTER(Address))(ULONG *address);
     91    STDMETHOD(COMGETTER(Address))(BYTE **address);
    9292    STDMETHOD(COMGETTER(ColorDepth))(ULONG *colorDepth);
    9393    STDMETHOD(COMGETTER(LineSize))(ULONG *lineSize);
     
    9898    STDMETHOD(NotifyUpdate)(ULONG x, ULONG y,
    9999                            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);
    102102    STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation, BOOL *supported);
    103103    STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported);
     
    179179    SDL_Surface *mSurfVRAM;
    180180
    181     void *mPtrVRAM;
     181    BYTE *mPtrVRAM;
    182182    ULONG mLineSize;
    183183    FramebufferPixelFormat_T mPixelFormat;
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r458 r470  
    387387
    388388    STDMETHOD(OnMousePointerShapeChange) (BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot,
    389                                           ULONG width, ULONG height, ULONG shape)
     389                                          ULONG width, ULONG height, BYTE *shape)
    390390    {
    391391        PointerShapeChangeData *data;
    392392        data = new PointerShapeChangeData (visible, alpha, xHot, yHot, width, height,
    393                                            (const uint8_t *) shape);
     393                                           shape);
    394394        Assert (data);
    395395        if (!data)
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r382 r470  
    7373{
    7474public:
    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) :
    7676        QEvent ((QEvent::Type) VBoxDefs::ResizeEventType), fmt (f), vr (v), lsz (l), wdt (w), hgt (h) {}
    7777    FramebufferPixelFormat_T  pixelFormat() { return fmt; }
    78     void *vram() { return vr; }
     78    uchar *vram() { return vr; }
    7979    unsigned lineSize() { return lsz; }
    8080    int width() { return wdt; }
     
    8282private:
    8383    FramebufferPixelFormat_T fmt;
    84     void *vr;
     84    uchar *vr;
    8585    unsigned lsz;
    8686    int wdt;
     
    204204
    205205    // IFramebuffer COM methods
    206     STDMETHOD(COMGETTER(Address)) (ULONG *aAddress);
     206    STDMETHOD(COMGETTER(Address)) (BYTE **aAddress);
    207207    STDMETHOD(COMGETTER(Width)) (ULONG *aWidth);
    208208    STDMETHOD(COMGETTER(Height)) (ULONG *aHeight);
     
    217217
    218218    STDMETHOD(RequestResize) (FramebufferPixelFormat_T aPixelFormat,
    219                               ULONG aVRAM, ULONG aLineSize,
     219                              BYTE *aVRAM, ULONG aLineSize,
    220220                              ULONG aWidth, ULONG aHeight,
    221221                              BOOL *aFinished);
     
    362362    SDL_Surface *mSurfVRAM;
    363363
    364     void *mPtrVRAM;
     364    uchar *mPtrVRAM;
    365365    ULONG mLineSize;
    366366    FramebufferPixelFormat_T mPixelFormat;
     
    397397    void releaseObjects();
    398398
    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);
    401401    void deleteSurface ();
    402402    void drawRect (ULONG x, ULONG y, ULONG w, ULONG h);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r382 r470  
    258258                                          ULONG xhot, ULONG yhot,
    259259                                          ULONG width, ULONG height,
    260                                           ULONG shape)
     260                                          BYTE *shape)
    261261    {
    262262        QApplication::postEvent (
    263263            view, new MousePointerChangeEvent (visible, alpha, xhot, yhot,
    264264                                               width, height,
    265                                                (const uchar*) shape)
     265                                               shape)
    266266        );
    267267        return S_OK;
     
    17851785                QImage shot = QImage (fb->width(), fb->height(), 32, 0);
    17861786                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());
    17891788                /*
    17901789                 *  TakeScreenShot() may fail if, e.g. the Paused notification
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBDDRAW.cpp

    r382 r470  
    279279 * and VBoxDDRAWFrameBuffer::mPixelFormat to format of the created surface.
    280280 */
    281 void VBoxDDRAWFrameBuffer::setupSurface (FramebufferPixelFormat_T pixelFormat, void *pvVRAM, ULONG lineSize, ULONG w, ULONG h)
     281void VBoxDDRAWFrameBuffer::setupSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h)
    282282{
    283283    /* Check requested pixel format. */
     
    315315 * the requested format is supported and the surface was successfully created.
    316316 */
    317 void VBoxDDRAWFrameBuffer::recreateSurface (FramebufferPixelFormat_T pixelFormat, void *pvVRAM, ULONG lineSize, ULONG w, ULONG h)
     317void VBoxDDRAWFrameBuffer::recreateSurface (FramebufferPixelFormat_T pixelFormat, uchar *pvVRAM, ULONG lineSize, ULONG w, ULONG h)
    318318{
    319319    HRESULT rc;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r382 r470  
    5959// Just forwarders to relevant class methods.
    6060
    61 STDMETHODIMP VBoxFrameBuffer::COMGETTER(Address) (ULONG *aAddress)
     61STDMETHODIMP VBoxFrameBuffer::COMGETTER(Address) (BYTE **aAddress)
    6262{
    6363    if (!aAddress)
    6464        return E_POINTER;
    65     *aAddress = (uintptr_t) address();
     65    *aAddress = address();
    6666    return S_OK;
    6767}
     
    140140/** @note This method is called on EMT from under this object's lock */
    141141STDMETHODIMP VBoxFrameBuffer::RequestResize (FramebufferPixelFormat_T aPixelFormat,
    142                                              ULONG aVRAM, ULONG aLineSize,
     142                                             BYTE *aVRAM, ULONG aLineSize,
    143143                                             ULONG aWidth, ULONG aHeight,
    144144                                             BOOL *aFinished)
    145145{
    146146    QApplication::postEvent (mView,
    147                              new VBoxResizeEvent (aPixelFormat, (void *) aVRAM,
     147                             new VBoxResizeEvent (aPixelFormat, aVRAM,
    148148                                                  aLineSize, aWidth, aHeight));
    149149
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r447 r470  
    32533253    CallbackList::iterator it = mCallbacks.begin();
    32543254    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);
    32563257}
    32573258
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r431 r470  
    197197    RTSemEventMultiReset(mResizeSem);
    198198
    199     mFramebuffer->RequestResize (pixelFormat, (ULONG)pvVRAM, cbLine, w, h, &finished);
     199    mFramebuffer->RequestResize (pixelFormat, (BYTE *) pvVRAM, cbLine, w, h, &finished);
    200200
    201201    if (!finished)
     
    270270
    271271        /* Framebuffer successfully set the requested format. */
    272         ULONG address;
     272        BYTE *address;
    273273        mFramebuffer->COMGETTER(Address) (&address);
    274274
     
    282282        uint32_t cbBuffer = cbLine * h;
    283283
    284         int rc = mpDrv->pUpPort->pfnSetupVRAM (mpDrv->pUpPort, (void *)address, cbBuffer);
     284        int rc = mpDrv->pUpPort->pfnSetupVRAM (mpDrv->pUpPort, address, cbBuffer);
    285285
    286286        if (VBOX_FAILURE(rc))
     
    12141214}
    12151215
    1216 STDMETHODIMP Display::LockFramebuffer (ULONG *address)
     1216STDMETHODIMP Display::LockFramebuffer (BYTE **address)
    12171217{
    12181218    if (!address)
     
    12291229        mFramebuffer->Lock();
    12301230        mFramebufferOpened = true;
    1231         *address = (ULONG)mpDrv->Connector.pu8Data;
     1231        *address = mpDrv->Connector.pu8Data;
    12321232        return S_OK;
    12331233    }
     
    13241324}
    13251325
    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)
     1326STDMETHODIMP Display::TakeScreenShot (BYTE *address, ULONG width, ULONG height)
    13401327{
    13411328    /// @todo (r=dmik) this function may take too long to complete if the VM
     
    13801367        rcVBox = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT,
    13811368                             (PFNRT)mpDrv->pUpPort->pfnSnapshot, 6, mpDrv->pUpPort,
    1382                              (void *)address, cbData, NULL, NULL, NULL);
     1369                             address, cbData, NULL, NULL, NULL);
    13831370        if (VBOX_SUCCESS(rcVBox))
    13841371        {
     
    14061393}
    14071394
    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,
     1395STDMETHODIMP Display::DrawToScreen (BYTE *address, ULONG x, ULONG y,
    14221396                                    ULONG width, ULONG height)
    14231397{
     
    14311405    LogFlowFunc (("address=%p, x=%d, y=%d, width=%d, height=%d\n",
    14321406                  address, x, y, width, height));
     1407
     1408    if (!address)
     1409        return E_POINTER;
     1410    if (!width || !height)
     1411        return E_INVALIDARG;
    14331412
    14341413    AutoLock lock(this);
     
    14471426    int rcVBox = VMR3ReqCall(pVM, &pReq, RT_INDEFINITE_WAIT,
    14481427                             (PFNRT)mpDrv->pUpPort->pfnDisplayBlt, 6, mpDrv->pUpPort,
    1449                              (void *)address, x, y, width, height);
     1428                             address, x, y, width, height);
    14501429    if (VBOX_SUCCESS(rcVBox))
    14511430    {
     
    16171596    {
    16181597        HRESULT rc;
    1619         ULONG address = 0;
     1598        BYTE *address = 0;
    16201599        rc = mFramebuffer->COMGETTER(Address) (&address);
    16211600        AssertComRC (rc);
     
    16401619         */
    16411620        if (aCheckParams &&
    1642             (mLastAddress != (uint8_t *) address ||
     1621            (mLastAddress != address ||
    16431622             mLastLineSize != lineSize ||
    16441623             mLastColorDepth != colorDepth ||
  • trunk/src/VBox/Main/FramebufferImpl.cpp

    r1 r470  
    5656/////////////////////////////////////////////////////////////////////////////
    5757
    58 STDMETHODIMP InternalFramebuffer::COMGETTER(Address) (ULONG *address)
     58STDMETHODIMP InternalFramebuffer::COMGETTER(Address) (BYTE **address)
    5959{
    6060    if (!address)
    6161        return E_POINTER;
    62     *address = (ULONG)mData;
     62    *address = mData;
    6363    return S_OK;
    6464}
     
    148148}
    149149
    150 STDMETHODIMP InternalFramebuffer::RequestResize(FramebufferPixelFormat_T pixelFormat, ULONG vram, ULONG lineSize, ULONG w, ULONG h,
    151                                                 BOOL *finished)
     150STDMETHODIMP
     151InternalFramebuffer::RequestResize(FramebufferPixelFormat_T pixelFormat, BYTE *vram,
     152                                   ULONG lineSize, ULONG w, ULONG h,
     153                                   BOOL *finished)
    152154{
    153155    if (!finished)
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r444 r470  
    23652365                </desc>
    23662366            </param>
    2367             <param name="shape" type="unsigned long" dir="in">
     2367            <param name="shape" type="octet" mod="ptr" dir="in">
    23682368                <desc>
    23692369                    Address of the shape buffer.
     
    53905390        uuid="4481F27F-5C79-48d9-86C1-A2EC6747034D"
    53915391    >
    5392         <attribute name="address" type="unsigned long" readonly="yes">
     5392        <attribute name="address" type="octet" mod="ptr" readonly="yes">
    53935393            <desc>Address of the start byte of the framebuffer.</desc>
    53945394        </attribute>
     
    55105510                <desc>Pixel format of the surface (BPP and layout)</desc>
    55115511            </param>
    5512             <param name="vram" type="unsigned long" dir="in">
     5512            <param name="vram" type="octet" mod="ptr" dir="in">
    55135513                <desc>Pointer to the guest VRAM (NULL for non linear modes)</desc>
    55145514            </param>
     
    56365636        <attribute name="colorDepth" type="unsigned long" readonly="yes">
    56375637            <desc>
    5638                 Current guest display color depth. Note that this might
    5639                 be different from <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>.
    56405640            </desc>
    56415641        </attribute>
     
    56525652               Requests access to the internal framebuffer.
    56535653            </desc>
    5654             <param name="address" type="unsigned long" dir="return"/>
     5654            <param name="address" type="octet" mod="ptr" dir="return"/>
    56555655        </method>
    56565656
     
    56895689                32-bpp buffer allocated by the caller.
    56905690            </desc>
    5691             <param name="address" type="unsigned long" dir="in"/>
     5691            <param name="address" type="octet" mod="ptr" dir="in"/>
    56925692            <param name="width" type="unsigned long" dir="in"/>
    56935693            <param name="height" type="unsigned long" dir="in"/>
     
    56995699                to the given point on the VM display.
    57005700            </desc>
    5701             <param name="address" type="unsigned long" dir="in"/>
     5701            <param name="address" type="octet" mod="ptr" dir="in"/>
    57025702            <param name="x" type="unsigned long" dir="in"/>
    57035703            <param name="y" type="unsigned long" dir="in"/>
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r255 r470  
    7979#endif /* VBOX_VRDP */
    8080
    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)
    8384    {
    8485        return S_OK;
     
    114115    // IDisplay methods
    115116    STDMETHOD(SetupInternalFramebuffer)(ULONG depth);
    116     STDMETHOD(LockFramebuffer)(ULONG *address);
     117    STDMETHOD(LockFramebuffer)(BYTE **address);
    117118    STDMETHOD(UnlockFramebuffer)();
    118119    STDMETHOD(RegisterExternalFramebuffer)(IFramebuffer *frameBuf);
    119120    STDMETHOD(SetVideoModeHint)(ULONG width, ULONG height, ULONG colorDepth);
    120     STDMETHOD(TakeScreenShot)(ULONG address, ULONG width, ULONG height);
    121     STDMETHOD(DrawToScreen)(ULONG address, 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);
    122123    STDMETHOD(InvalidateAndUpdate)();
    123124    STDMETHOD(ResizeCompleted)();
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r1 r470  
    4848
    4949    // IFramebuffer properties
    50     STDMETHOD(COMGETTER(Address)) (ULONG *address);
     50    STDMETHOD(COMGETTER(Address)) (BYTE **address);
    5151    STDMETHOD(COMGETTER(Width)) (ULONG *width);
    5252    STDMETHOD(COMGETTER(Height)) (ULONG *height);
     
    6363                            ULONG w, ULONG h,
    6464                            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,
    6667                             BOOL *finished);
    6768    STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette