VirtualBox

Changeset 6508 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 25, 2008 10:28:07 AM (17 years ago)
Author:
vboxsync
Message:

r=bird: spaces and doxygen. (btw. @retval isn't supposed to be used for parameters.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils-new.c

    r6497 r6508  
    11/** @file
    2  *
    32 * VirtualBox X11 Additions graphics driver utility functions
    43 */
     
    3736#ifdef DEBUG_X
    3837#define TRACE_ENTRY() for (;;) \
    39 { \
    40     ErrorF ("%s\n", __FUNCTION__); \
    41     break; \
    42 }
     38    { \
     39        ErrorF ("%s\n", __FUNCTION__); \
     40        break; \
     41    }
    4342#define PUT_PIXEL(c) ErrorF ("%c", c)
    4443#define dolog(...) ErrorF  (__VA_ARGS__)
     
    5150/** Macro to printf an error message and return from a function */
    5251#define RETERROR(scrnIndex, RetVal, ...) \
    53 do \
    54 { \
    55     xf86DrvMsg(scrnIndex, X_ERROR, __VA_ARGS__); \
    56     return RetVal; \
    57 } \
    58 while (0)
     52    do \
     53    { \
     54        xf86DrvMsg(scrnIndex, X_ERROR, __VA_ARGS__); \
     55        return RetVal; \
     56    } \
     57    while (0)
    5958
    6059#ifdef DEBUG_X
     
    108107    if (VBOX_FAILURE(rc))
    109108        RETERROR(scrnIndex, FALSE,
    110             "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc);
     109                 "Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code %d\n", rc);
    111110
    112111    return (fFeatures & VBOXGUEST_MOUSE_HOST_CANNOT_HWPOINTER) ? FALSE : TRUE;
     
    129128 */
    130129#define DISABLE_VBVA_AND_RETURN(pScrn, ...) \
    131 do \
    132 { \
    133     xf86DrvMsg(pScrn->scrnIndex, X_ERROR, __VA_ARGS__); \
    134     vboxDisableVbva(pScrn); \
    135     pVBox->useVbva = FALSE; \
    136     return; \
    137 } \
    138 while (0)
     130    do \
     131    { \
     132        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, __VA_ARGS__); \
     133        vboxDisableVbva(pScrn); \
     134        pVBox->useVbva = FALSE; \
     135        return; \
     136    } \
     137    while (0)
    139138
    140139/**
     
    244243            memcpy(&pMem->au8RingBuffer[off32Free], &cmdHdr, u32First);
    245244            if (u32Second)
    246                 memcpy(&pMem->au8RingBuffer[0], (void *)pu8Second, u32Second);
     245                memcpy(&pMem->au8RingBuffer[0], pu8Second, u32Second);
    247246            pMem->off32Free = u32Second;
    248247        }
     
    337336    }
    338337
    339     size = vmmdevGetRequestSize (VMMDevReq_SetPointerShape);
     338    size = vmmdevGetRequestSize(VMMDevReq_SetPointerShape);
    340339    p = xcalloc(1, size);
    341340    if (p)
     
    366365    pVBox->reqp->fFlags = 0;
    367366    rc = VbglR3SetPointerShape(0, pVBox->reqp->xHot, pVBox->reqp->yHot, pVBox->reqp->width,
    368             pVBox->reqp->height, pVBox->reqp->pointerData,
    369             pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
     367                               pVBox->reqp->height, pVBox->reqp->pointerData,
     368                               pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
    370369    if (RT_FAILURE(rc))
    371370        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not hide the virtual mouse pointer.\n");
     
    378377    pVBox->reqp->fFlags = VBOX_MOUSE_POINTER_VISIBLE;
    379378    rc = VbglR3SetPointerShape(VBOX_MOUSE_POINTER_VISIBLE, pVBox->reqp->xHot, pVBox->reqp->yHot,
    380             pVBox->reqp->width, pVBox->reqp->height, pVBox->reqp->pointerData,
    381             pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
     379                               pVBox->reqp->width, pVBox->reqp->height, pVBox->reqp->pointerData,
     380                               pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
    382381    if (RT_FAILURE(rc))
    383382        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not unhide the virtual mouse pointer.\n");
     
    386385static void
    387386vbox_vmm_load_cursor_image(ScrnInfoPtr pScrn, VBOXPtr pVBox,
    388                                         unsigned char *image)
     387                           unsigned char *image)
    389388{
    390389    int rc;
     
    398397
    399398    rc = VbglR3SetPointerShape(reqp->fFlags, reqp->xHot, reqp->yHot, reqp->width, reqp->height,
    400                         reqp->pointerData, reqp->header.size - pVBox->set_pointer_shape_size);
     399                               reqp->pointerData, reqp->header.size - pVBox->set_pointer_shape_size);
    401400    if (RT_FAILURE(rc))
    402401        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,  "Unable to set the virtual mouse pointer image.\n");
     
    424423     * since the mouse cursor is drawn by the host anyway */
    425424#if 0
    426     if (((x < 0) || (x > pScrn->pScreen->width))
    427         || ((y < 0) || (y > pScrn->pScreen->height)))
     425    if (   (x < 0 || x > pScrn->pScreen->width)
     426        || (y < 0 || y > pScrn->pScreen->height))
    428427    {
    429428        if (!pVBox->pointer_offscreen)
     
    539538    dolog ("w=%d h=%d sm=%d sr=%d p=%d\n",
    540539           w, h, (int) size_mask, (int) size_rgba, (int) dst_pitch);
    541     dolog ("m=%p c=%p cp=%p\n", m, c, (void *)cp);
     540    dolog ("m=%p c=%p cp=%p\n", m, c, cp);
    542541
    543542    fc = color_to_byte (pCurs->foreBlue)
     
    646645
    647646    /* Mask must be generated for alpha cursors, that is required by VBox. */
    648     /* @note: (michael) the next struct must be 32bit aligned. */
     647    /* note: (michael) the next struct must be 32bit aligned. */
    649648    mask_size  = ((w + 7) / 8 * h + 3) & ~3;
    650649
     
    684683    memset(pm, 0xFF, mask_size);
    685684
    686     /**
     685    /*
    687686     * The additions driver must provide the AND mask for alpha cursors. The host frontend
    688687     * which can handle alpha channel, will ignore the AND mask and draw an alpha cursor.
     
    709708
    710709    VbglR3SetPointerShape(VBOX_MOUSE_POINTER_SHAPE | VBOX_MOUSE_POINTER_ALPHA, bitsp->xhot, bitsp->yhot, w, h,
    711                 (void *)pm, reqp->header.size - pVBox->set_pointer_shape_size);
     710                          pm, reqp->header.size - pVBox->set_pointer_shape_size);
    712711    xfree(p);
    713712}
     
    769768 *
    770769 * @returns TRUE for success, FALSE for failure
    771  * @param   pScreen Pointer to a structure describing the X screen in use
     770 * @param   pScr Pointer to a structure describing the X screen in use
    772771 */
    773772Bool
     
    780779    if (pVBox->useVbva != TRUE)
    781780        return FALSE;
    782     rc = VbglR3VideoAccelEnable(1);
     781    rc = VbglR3VideoAccelEnable(true);
    783782    if (RT_FAILURE(rc))
    784783    {
     
    789788                   "You may be running an old version of VirtualBox.\n");
    790789        pVBox->useVbva = FALSE;
    791         VbglR3VideoAccelEnable(0);
     790        VbglR3VideoAccelEnable(false);
    792791        return FALSE;
    793792    }
     
    801800 *
    802801 * @returns TRUE for success, FALSE for failure
    803  * @param   pScreen Pointer to a structure describing the X screen in use
     802 * @param   pScr Pointer to a structure describing the X screen in use
    804803 */
    805804Bool
     
    812811    if (pVBox->useVbva != TRUE)  /* Ths function should not have been called */
    813812        return FALSE;
    814     rc = VbglR3VideoAccelEnable(0);
     813    rc = VbglR3VideoAccelEnable(false);
    815814    if (RT_FAILURE(rc))
    816815    {
    817816        xf86DrvMsg(scrnIndex, X_ERROR,
    818             "Unable to disable VirtualBox graphics acceleration "
    819             "- the request to the virtual machine failed.\n");
     817                   "Unable to disable VirtualBox graphics acceleration "
     818                   "- the request to the virtual machine failed.\n");
    820819    }
    821820    else
     
    827826 * Query the last display change request.
    828827 *
    829  * @returns iprt status value
    830  * @retval xres     horizontal pixel resolution (0 = do not change)
    831  * @retval yres     vertical pixel resolution (0 = do not change)
    832  * @retval bpp      bits per pixel (0 = do not change)
    833  * @param  eventAck Flag that the request is an acknowlegement for the
    834  *                  VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
    835  *                  Values:
    836  *                      0                                   - just querying,
    837  *                      VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
    838  * @param  display  0 for primary display, 1 for the first secondary, etc.
     828 * @returns boolean success indicator.
     829 * @param   pScrn       Pointer to the X screen info structure.
     830 * @param   pcx         Where to store the horizontal pixel resolution (0 = do not change).
     831 * @param   pcy         Where to store the vertical pixel resolution (0 = do not change).
     832 * @param   pcBits      Where to store the bits per pixel (0 = do not change).
     833 * @param   fEventAck   Flag that the request is an acknowlegement for the
     834 *                      VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
     835 *                      Values:
     836 *                          0                                   - just querying,
     837 *                          VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
     838 * @param   iDisplay    0 for primary display, 1 for the first secondary, etc.
    839839 */
    840840Bool
    841 vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *px, uint32_t *py,
    842                             uint32_t *pbpp, uint32_t eventAck, uint32_t display)
    843 {
    844     int rc, scrnIndex = pScrn->scrnIndex;
    845     rc = VbglR3GetDisplayChangeRequest(px, py, pbpp, eventAck, display);
     841vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy,
     842                            uint32_t *pcBits, uint32_t fEventAck, uint32_t iDisplay)
     843{
     844    int rc = VbglR3GetDisplayChangeRequest(pcx, pcy, pcBits, fEventAck, iDisplay);
    846845    if (RT_SUCCESS(rc))
    847846        return TRUE;
    848     xf86DrvMsg(scrnIndex, X_ERROR, "Failed to request the last resolution requested from the guest, rc=%d.\n", rc);
     847    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to request the last resolution requested from the guest, rc=%d.\n", rc);
    849848    return FALSE;
    850849}
     850
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