VBoxGuestR3LibVideo.cpp revision 39a628c9e979cb2355caa57eb099b13cb922783c
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Video.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Copyright (C) 2007 Sun Microsystems, Inc.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * available from http://www.virtualbox.org. This file is free software;
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * General Public License (GPL) as published by the Free Software
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * additional information or have any questions.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync/*******************************************************************************
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync* Header Files *
c312e1b81dffe42e0fb766020fb8defaeade05d6vboxsync*******************************************************************************/
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync#include <VBox/HostServices/GuestPropertySvc.h> /* For Save and RetrieveVideoMode */
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync#define VIDEO_PROP_PREFIX "/VirtualBox/GuestAdd/Vbgl/Video/"
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Enable or disable video acceleration.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @returns VBox status code.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param fEnable Pass zero to disable, any other value to enable.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsyncVBGLR3DECL(int) VbglR3VideoAccelEnable(bool fEnable)
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync vmmdevInitRequest(&Req.header, VMMDevReq_VideoAccelEnable);
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * Flush the video buffer.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @returns VBox status code.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync vmmdevInitRequest(&Req.header, VMMDevReq_VideoAccelFlush);
50f0e2e83362e100d306a411980d555d46aa00a8vboxsync * Send mouse pointer shape information to the host.
54828795a553ed0731f308ebda81675ad2c39d58vboxsync * @returns VBox status code.
54828795a553ed0731f308ebda81675ad2c39d58vboxsync * @param fFlags Mouse pointer flags.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param xHot X coordinate of hot spot.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param yHot Y coordinate of hot spot.
54828795a553ed0731f308ebda81675ad2c39d58vboxsync * @param cx Pointer width.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param cy Pointer height.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param pvImg Pointer to the image data (can be NULL).
b0dfb334954c0552bb583967a3077ec88fd00471vboxsync * @param cbImg Size of the image data pointed to by pvImg.
b0dfb334954c0552bb583967a3077ec88fd00471vboxsyncVBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg)
50f0e2e83362e100d306a411980d555d46aa00a8vboxsync int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, RT_OFFSETOF(VMMDevReqMousePointer, pointerData) + cbImg, VMMDevReq_SetPointerShape);
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * Send mouse pointer shape information to the host.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * This version of the function accepts a request for clients that
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * already allocate and manipulate the request structure directly.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @returns VBox status code.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @param pReq Pointer to the VMMDevReqMousePointer structure.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsyncVBGLR3DECL(int) VbglR3SetPointerShapeReq(VMMDevReqMousePointer *pReq)
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * Query the last display change request.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @returns iprt status value
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @param pcx Where to store the horizontal pixel resolution (0 = do not change).
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @param pcy Where to store the vertical pixel resolution (0 = do not change).
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @param pcBits Where to store the bits per pixel (0 = do not change).
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * @param iDisplay Where to store the display number the request was for - 0 for the
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsync * primary display, 1 for the first secondary, etc.
8d29e9dc0d280b7b26834132b9ce14a3a845a7fdvboxsyncVBGLR3DECL(int) VbglR3GetLastDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay)
#ifndef VBOX_VBGLR3_XFREE86
return rc;
VBGLR3DECL(int) VbglR3DisplayChangeWaitEvent(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits, uint32_t *piDisplay)
int rc;
#ifndef VBOX_VBGLR3_XFREE86
return rc;
int rc;
return fRc;
#ifdef VBOX_WITH_GUEST_PROPS
using namespace guestProp;
if (u32ClientId != 0)
return rc;
return VERR_NOT_IMPLEMENTED;
VBGLR3DECL(int) VbglR3RetrieveVideoMode(const char *pszName, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits)
#ifdef VBOX_WITH_GUEST_PROPS
using namespace guestProp;
/** @todo add a VbglR3GuestPropReadValueF/FV that does the RTStrPrintf for you. */
char *pszNext;
++pszNext;
++pszNext;
if (u32ClientId != 0)
return rc;
return VERR_NOT_IMPLEMENTED;