VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp@ 6494

Last change on this file since 6494 was 6494, checked in by vboxsync, 17 years ago

VBoxGuestR3LibVideo and X11 vboxutils that uses it. Some typos and comments
to mouse vboxutils and VBoxGuestR3LibMouse.

  • Property svn:eol-style set to native
  • Property svn:keyword set to Id
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/* $Id: VBoxGuestR3LibMouse.cpp 6494 2008-01-25 06:11:27Z vboxsync $ */
2/** @file
3 * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Mouse.
4 */
5
6/*
7 * Copyright (C) 2007 innotek GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include "VBGLR3Internal.h"
23
24
25/**
26 * Retrieve mouse co-ordinate information from the host.
27 *
28 * @returns VBox status code.
29 *
30 * @param pfFeatures Where to store the mouse features.
31 * @param px Where to store the X co-ordinate.
32 * @param py Where to store the Y co-ordinate.
33 */
34VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pfFeatures, uint32_t *px, uint32_t *py)
35{
36 VMMDevReqMouseStatus Req;
37 vmmdevInitRequest(&Req.header, VMMDevReq_GetMouseStatus);
38 Req.mouseFeatures = 0;
39 Req.pointerXPos = 0;
40 Req.pointerYPos = 0;
41 int rc = vbglR3GRPerform(&Req.header);
42 if (RT_SUCCESS(rc))
43 {
44 if (pfFeatures)
45 *pfFeatures = Req.mouseFeatures;
46 if (px)
47 *px = Req.pointerXPos;
48 if (py)
49 *py = Req.pointerYPos;
50 }
51 return rc;
52}
53
54
55/**
56 * Send mouse features to the host.
57 *
58 * @returns VBox status code.
59 *
60 * @param fFeatures Supported mouse pointer features.
61 */
62VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t fFeatures)
63{
64 VMMDevReqMouseStatus Req;
65 vmmdevInitRequest(&Req.header, VMMDevReq_SetMouseStatus);
66 Req.mouseFeatures = fFeatures;
67 Req.pointerXPos = 0;
68 Req.pointerYPos = 0;
69 return vbglR3GRPerform(&Req.header);
70}
71
Note: See TracBrowser for help on using the repository browser.

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