xorg/driver/xf86-input-void: [PATCH 1/2] Janitor: update for ABI_XINPUT_VERSION >= 5
Peter Hutterer
peter.hutterer at who-t.net
Sat Feb 14 15:25:43 PST 2009
On Thu, Feb 05, 2009 at 06:03:30PM -0200, Paulo César Pereira de Andrade wrote:
> From fafd4f546bf75e71ce92feaa52d50699fae81a21 Mon Sep 17 00:00:00 2001
> From: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
> Date: Thu, 5 Feb 2009 17:30:18 -0200
> Subject: [PATCH 1/2] Janitor: update for ABI_XINPUT_VERSION >= 5
>
> This driver should be seen as the simplest possible input
> driver, and somewhat as a skeleton/model for newer ones.
> Having it at least compiling with current xorg sdk is a plus.
>
> Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
> ---
> src/void.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/src/void.c b/src/void.c
> index a5a47be..5a110f1 100644
> --- a/src/void.c
> +++ b/src/void.c
> @@ -57,6 +57,7 @@
> /******************************************************************************
> * Function/Macro keys variables
> *****************************************************************************/
> +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
> static KeySym void_map[] =
> {
> NoSymbol, NoSymbol, NoSymbol, NoSymbol,
> @@ -130,6 +131,7 @@ static KeySymsRec void_keysyms = {
> /* map minKeyCode maxKeyCode width */
> void_map, 8, 255, 1
> };
> +#endif /* GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5 */
>
> static const char *DEFAULTS[] = {
> NULL
> @@ -172,6 +174,10 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
> InputInfoPtr pInfo;
> unsigned char map[MAXBUTTONS + 1];
> int i;
> +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
> + XkbRMLVOSet rmlvo;
> +#endif
> + Bool result;
>
> pInfo = device->public.devicePrivate;
>
> @@ -202,7 +208,16 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
> return !Success;
> }
> */
> - if (InitKeyboardDeviceStruct((DevicePtr)device, &void_keysyms, NULL, BellProc, KeyControlProc) == FALSE) {
> +
> +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
> + memset(&rmlvo, 0, sizeof(XkbRMLVOSet));
> + result = InitKeyboardDeviceStruct(device, &rmlvo,
> + BellProc, KeyControlProc);
> +#else
> + result = InitKeyboardDeviceStruct((DevicePtr)device, &void_keysyms,
> + NULL, BellProc, KeyControlProc);
> +#endif
> + if (result == FALSE) {
> ErrorF("unable to init keyboard device\n");
> return !Success;
> }
> --
> 1.6.1
Thanks, applied with one minor change. if (result == FALSE) -> if (!result)
Cheers,
Peter
More information about the xorg
mailing list