/** @file
* VirtualBox X11 Guest Additions, mouse driver for X.Org server 1.5
*/
/*
* Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
* --------------------------------------------------------------------
*
* This code is based on evdev.c from X.Org with the following copyright
* and permission notice:
*
* Copyright © 2004-2008 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of Red Hat
* not be used in advertising or publicity pertaining to distribution
* of the software without specific, written prior permission. Red
* Hat makes no representations about the suitability of this software
* for any purpose. It is provided "as is" without express or implied
* warranty.
*
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Authors:
* Kristian Høgsberg (krh@redhat.com)
* Adam Jackson (ajax@redhat.com)
*/
#include <VBox/VBoxGuestLib.h>
#include <xf86.h>
#include <xf86Xinput.h>
#include <mipointer.h>
#include <xf86Module.h>
#ifdef VBOX_GUESTR3XF86MOD
# define _X_EXPORT
#else
# include <errno.h>
# include <fcntl.h>
# include <unistd.h>
#endif
#include "product-generated.h"
static void
{
/* Read a byte from the device to acknowledge the event */
char c;
/* The first test here is a workaround for an apparent bug in Xorg Server 1.5 */
if (
#else
#endif
{
/* Bug in the 1.4 X server series - conversion_proc was no longer
* called, but the server didn't yet do the conversion itself. */
#endif
/* send absolute movement */
}
}
static void
{
/* Nothing to do, dix handles all settings */
}
static int
{
#endif
2 /* Number of axes */
#else
#endif
#endif
))
return !Success;
/* Tell the server about the range of axis values we report */
#else
axis_labels[0],
# endif
10000, 0, 10000
, Absolute
# endif
);
axis_labels[1],
# endif
10000, 0, 10000
, Absolute
# endif
);
#endif
return Success;
}
static int
{
switch (what)
{
case DEVICE_INIT:
VbglR3Term();
return xrc;
}
break;
case DEVICE_ON:
break;
/* Tell the host that we want absolute co-ordinates */
if (!RT_SUCCESS(rc)) {
return !Success;
}
break;
case DEVICE_OFF:
if (RT_SUCCESS(rc))
break;
case DEVICE_CLOSE:
VbglR3Term();
break;
default:
return BadValue;
}
return Success;
}
static int
{
if (!RT_SUCCESS(rc)) {
return BadMatch;
}
return Success;
}
static Bool
{
if (first == 0) {
return TRUE;
} else
return FALSE;
}
static int
{
const char *device;
int rc;
/* Initialise the InputInfoRec. */
/* Unlike evdev, we set this unconditionally, as we don't handle keyboards. */
do {
}
return BadMatch;
}
return rc;
return Success;
}
static InputInfoPtr
{
const char *device;
return NULL;
/* Initialise the InputInfoRec. */
xf86DeleteInput(pInfo, 0);
return NULL;
}
return pInfo;
}
#endif
1,
"vboxmouse",
NULL,
#else
#endif
NULL,
NULL,
0
};
static pointer
int *errmaj,
int *errmin)
{
(void *)&VBOXMOUSE);
return module;
}
{
"vboxmouse",
0, /* Missing from SDK: XORG_VERSION_CURRENT, */
1, 0, 0,
{0, 0, 0, 0}
};
{
};