aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/input
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
commit2553bdd7c359cd87525d367761c86932cec5adff (patch)
treeae71245933c98474a699d3e392de5820879b2018 /xorg-server/hw/dmx/input
parente2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff)
parent4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff)
downloadvcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/dmx/input')
-rw-r--r--xorg-server/hw/dmx/input/Makefile.am2
-rw-r--r--xorg-server/hw/dmx/input/Makefile.in82
-rw-r--r--xorg-server/hw/dmx/input/atKeynames.h295
-rw-r--r--xorg-server/hw/dmx/input/dmxbackend.c5
-rw-r--r--xorg-server/hw/dmx/input/dmxcommon.h4
-rw-r--r--xorg-server/hw/dmx/input/dmxconsole.c5
-rw-r--r--xorg-server/hw/dmx/input/dmxeq.c31
-rw-r--r--xorg-server/hw/dmx/input/dmxevents.c45
-rw-r--r--xorg-server/hw/dmx/input/dmxinputinit.c52
-rw-r--r--xorg-server/hw/dmx/input/dmxmotion.c3
-rw-r--r--xorg-server/hw/dmx/input/dmxxinput.c8
-rw-r--r--xorg-server/hw/dmx/input/lnx-keyboard.c5
-rw-r--r--xorg-server/hw/dmx/input/lnx-ms.c5
-rw-r--r--xorg-server/hw/dmx/input/lnx-ps2.c5
-rw-r--r--xorg-server/hw/dmx/input/usb-common.c5
15 files changed, 367 insertions, 185 deletions
diff --git a/xorg-server/hw/dmx/input/Makefile.am b/xorg-server/hw/dmx/input/Makefile.am
index da8de0546..8ea500316 100644
--- a/xorg-server/hw/dmx/input/Makefile.am
+++ b/xorg-server/hw/dmx/input/Makefile.am
@@ -49,6 +49,7 @@ DMXSRCS = dmxinputinit.c \
libdmxinput_a_SOURCES = ChkNotMaskEv.c \
ChkNotMaskEv.h \
+ atKeynames.h \
$(RAWSRCS) \
$(USBSRCS) \
$(DRVSRCS) \
@@ -62,7 +63,6 @@ endif
AM_CFLAGS = $(DIX_CFLAGS) \
-I$(top_srcdir)/hw/dmx \
- -I$(top_srcdir)/hw/xfree86/common \
$(GLX_INCS) \
-DHAVE_DMX_CONFIG_H \
$(GLX_DEFS) \
diff --git a/xorg-server/hw/dmx/input/Makefile.in b/xorg-server/hw/dmx/input/Makefile.in
index bbac88828..472017165 100644
--- a/xorg-server/hw/dmx/input/Makefile.in
+++ b/xorg-server/hw/dmx/input/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -43,7 +43,6 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-server.h \
$(top_builddir)/include/dix-config.h \
- $(top_builddir)/include/xgl-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
@@ -54,8 +53,8 @@ ARFLAGS = cru
libdmxinput_a_AR = $(AR) $(ARFLAGS)
libdmxinput_a_LIBADD =
am__libdmxinput_a_SOURCES_DIST = ChkNotMaskEv.c ChkNotMaskEv.h \
- lnx-keyboard.c lnx-keyboard.h lnx-ms.c lnx-ms.h lnx-ps2.c \
- lnx-ps2.h usb-keyboard.c usb-keyboard.h usb-mouse.c \
+ atKeynames.h lnx-keyboard.c lnx-keyboard.h lnx-ms.c lnx-ms.h \
+ lnx-ps2.c lnx-ps2.h usb-keyboard.c usb-keyboard.h usb-mouse.c \
usb-mouse.h usb-other.c usb-other.h usb-common.c usb-common.h \
usb-private.h dmxdummy.c dmxdummy.h dmxbackend.c dmxbackend.h \
dmxconsole.c dmxconsole.h dmxcommon.c dmxcommon.h \
@@ -80,9 +79,6 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
@@ -97,8 +93,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
-APPDEFAULTDIR = @APPDEFAULTDIR@
APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@
+APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -119,10 +116,6 @@ CFLAGS = @CFLAGS@
COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DARWIN_LIBS = @DARWIN_LIBS@
DBUS_CFLAGS = @DBUS_CFLAGS@
@@ -144,6 +137,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DOLT_BASH = @DOLT_BASH@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
@@ -153,18 +147,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
DSYMUTIL = @DSYMUTIL@
DTRACE = @DTRACE@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
-FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
-FREETYPE_LIBS = @FREETYPE_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GL_CFLAGS = @GL_CFLAGS@
@@ -183,7 +174,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@
KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
-LAUNCHD = @LAUNCHD@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
LEX = @LEX@
@@ -197,7 +188,10 @@ LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINUXDOC = @LINUXDOC@
+LIPO = @LIPO@
LN_S = @LN_S@
+LTCOMPILE = @LTCOMPILE@
+LTCXXCOMPILE = @LTCXXCOMPILE@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -209,8 +203,7 @@ MESA_SOURCE = @MESA_SOURCE@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
-MKFONTDIR = @MKFONTDIR@
-MKFONTSCALE = @MKFONTSCALE@
+NM = @NM@
NMEDIT = @NMEDIT@
OBJC = @OBJC@
OBJCCLD = @OBJCCLD@
@@ -219,8 +212,8 @@ OBJCFLAGS = @OBJCFLAGS@
OBJCLINK = @OBJCLINK@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
-OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
-OPENSSL_LIBS = @OPENSSL_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
@@ -253,7 +246,6 @@ VENDOR_NAME = @VENDOR_NAME@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
-X11APP_ARCHS = @X11APP_ARCHS@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
@@ -263,27 +255,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
XDMX_CFLAGS = @XDMX_CFLAGS@
XDMX_LIBS = @XDMX_LIBS@
XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
-XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
-XEGL_LIBS = @XEGL_LIBS@
-XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
-XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
XEPHYR_INCS = @XEPHYR_INCS@
XEPHYR_LIBS = @XEPHYR_LIBS@
XF86CONFIGFILE = @XF86CONFIGFILE@
-XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
-XF86MISC_LIBS = @XF86MISC_LIBS@
XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
-XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
-XGLMODULES_LIBS = @XGLMODULES_LIBS@
-XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
-XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
-XGLX_LIBS = @XGLX_LIBS@
-XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
-XGL_LIBS = @XGL_LIBS@
-XGL_MODULE_PATH = @XGL_MODULE_PATH@
-XGL_SYS_LIBS = @XGL_SYS_LIBS@
XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
@@ -294,10 +271,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_LIBS = @XNEST_LIBS@
XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
-XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
-XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
-XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
-XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
@@ -306,13 +279,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
XORG_OS = @XORG_OS@
XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
XORG_SYS_LIBS = @XORG_SYS_LIBS@
-XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
-XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
-XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
-XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
-XPRINT_CFLAGS = @XPRINT_CFLAGS@
-XPRINT_LIBS = @XPRINT_LIBS@
-XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
+XPBPROXY_LIBS = @XPBPROXY_LIBS@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSDL_INCS = @XSDL_INCS@
@@ -345,8 +313,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
@@ -366,7 +333,6 @@ driverdir = @driverdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
extdir = @extdir@
-ft_config = @ft_config@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -376,12 +342,12 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
-launchagentsdir = @launchagentsdir@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
logdir = @logdir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
moduledir = @moduledir@
@@ -399,8 +365,6 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-xglmoduledir = @xglmoduledir@
-xpconfigdir = @xpconfigdir@
noinst_LIBRARIES = libdmxinput.a
@DMX_BUILD_LNX_TRUE@RAWSRCS = lnx-keyboard.c \
@DMX_BUILD_LNX_TRUE@ lnx-keyboard.h \
@@ -446,6 +410,7 @@ DMXSRCS = dmxinputinit.c \
libdmxinput_a_SOURCES = ChkNotMaskEv.c \
ChkNotMaskEv.h \
+ atKeynames.h \
$(RAWSRCS) \
$(USBSRCS) \
$(DRVSRCS) \
@@ -456,7 +421,6 @@ libdmxinput_a_SOURCES = ChkNotMaskEv.c \
@GLX_TRUE@GLX_INCS = -I@MESA_SOURCE@/include
AM_CFLAGS = $(DIX_CFLAGS) \
-I$(top_srcdir)/hw/dmx \
- -I$(top_srcdir)/hw/xfree86/common \
$(GLX_INCS) \
-DHAVE_DMX_CONFIG_H \
$(GLX_DEFS) \
@@ -471,8 +435,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
@@ -563,7 +527,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
diff --git a/xorg-server/hw/dmx/input/atKeynames.h b/xorg-server/hw/dmx/input/atKeynames.h
new file mode 100644
index 000000000..85f13ac32
--- /dev/null
+++ b/xorg-server/hw/dmx/input/atKeynames.h
@@ -0,0 +1,295 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * 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 Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL 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.
+ *
+ */
+/*
+ * Copyright (c) 1994-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef _ATKEYNAMES_H
+#define _ATKEYNAMES_H
+
+#define XK_TECHNICAL
+#define XK_KATAKANA
+#include <X11/keysym.h>
+#include <X11/XF86keysym.h>
+
+#define GLYPHS_PER_KEY 4
+#define NUM_KEYCODES 248
+#define MIN_KEYCODE 8
+#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1)
+
+#define AltMask Mod1Mask
+#define NumLockMask Mod2Mask
+#define AltLangMask Mod3Mask
+#define KanaMask Mod4Mask
+#define ScrollLockMask Mod5Mask
+
+#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7)))
+#define ModifierDown(k) ((keyc->state & (k)) == (k))
+
+/*
+ * NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three)
+ * sets of scancodes. Set3 can only be generated by a MF keyboard.
+ * Set2 sends a makecode for keypress, and the same code prefixed by a
+ * F0 for keyrelease. This is a little bit ugly to handle. Thus we use
+ * here for X386 the PC/XT compatible Set1. This set uses 8bit scancodes.
+ * Bit 7 ist set if the key is released. The code E0 switches to a
+ * different meaning to add the new MF cursorkeys, while not breaking old
+ * applications. E1 is another special prefix. Since I assume that there
+ * will be further versions of PC/XT scancode compatible keyboards, we
+ * may be in trouble one day.
+ *
+ * IDEA: 1) Use Set2 on AT84 keyboards and translate it to MF Set3.
+ * 2) Use the keyboards native set and translate it to common keysyms.
+ */
+
+/*
+ * definition of the AT84/MF101/MF102 Keyboard:
+ * ============================================================
+ * Defined Key Cap Glyphs Pressed value
+ * Key Name Main Also (hex) (dec)
+ * ---------------- ---------- ------- ------ ------
+ */
+
+#define KEY_Escape /* Escape 0x01 */ 1
+#define KEY_1 /* 1 ! 0x02 */ 2
+#define KEY_2 /* 2 @ 0x03 */ 3
+#define KEY_3 /* 3 # 0x04 */ 4
+#define KEY_4 /* 4 $ 0x05 */ 5
+#define KEY_5 /* 5 % 0x06 */ 6
+#define KEY_6 /* 6 ^ 0x07 */ 7
+#define KEY_7 /* 7 & 0x08 */ 8
+#define KEY_8 /* 8 * 0x09 */ 9
+#define KEY_9 /* 9 ( 0x0a */ 10
+#define KEY_0 /* 0 ) 0x0b */ 11
+#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12
+#define KEY_Equal /* = (Equal) + 0x0d */ 13
+#define KEY_BackSpace /* Back Space 0x0e */ 14
+#define KEY_Tab /* Tab 0x0f */ 15
+#define KEY_Q /* Q 0x10 */ 16
+#define KEY_W /* W 0x11 */ 17
+#define KEY_E /* E 0x12 */ 18
+#define KEY_R /* R 0x13 */ 19
+#define KEY_T /* T 0x14 */ 20
+#define KEY_Y /* Y 0x15 */ 21
+#define KEY_U /* U 0x16 */ 22
+#define KEY_I /* I 0x17 */ 23
+#define KEY_O /* O 0x18 */ 24
+#define KEY_P /* P 0x19 */ 25
+#define KEY_LBrace /* [ { 0x1a */ 26
+#define KEY_RBrace /* ] } 0x1b */ 27
+#define KEY_Enter /* Enter 0x1c */ 28
+#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29
+#define KEY_A /* A 0x1e */ 30
+#define KEY_S /* S 0x1f */ 31
+#define KEY_D /* D 0x20 */ 32
+#define KEY_F /* F 0x21 */ 33
+#define KEY_G /* G 0x22 */ 34
+#define KEY_H /* H 0x23 */ 35
+#define KEY_J /* J 0x24 */ 36
+#define KEY_K /* K 0x25 */ 37
+#define KEY_L /* L 0x26 */ 38
+#define KEY_SemiColon /* ;(SemiColon) :(Colon) 0x27 */ 39
+#define KEY_Quote /* ' (Apostr) " (Quote) 0x28 */ 40
+#define KEY_Tilde /* ` (Accent) ~ (Tilde) 0x29 */ 41
+#define KEY_ShiftL /* Shift(left) 0x2a */ 42
+#define KEY_BSlash /* \(BckSlash) |(VertBar)0x2b */ 43
+#define KEY_Z /* Z 0x2c */ 44
+#define KEY_X /* X 0x2d */ 45
+#define KEY_C /* C 0x2e */ 46
+#define KEY_V /* V 0x2f */ 47
+#define KEY_B /* B 0x30 */ 48
+#define KEY_N /* N 0x31 */ 49
+#define KEY_M /* M 0x32 */ 50
+#define KEY_Comma /* , (Comma) < (Less) 0x33 */ 51
+#define KEY_Period /* . (Period) >(Greater)0x34 */ 52
+#define KEY_Slash /* / (Slash) ? 0x35 */ 53
+#define KEY_ShiftR /* Shift(right) 0x36 */ 54
+#define KEY_KP_Multiply /* * 0x37 */ 55
+#define KEY_Alt /* Alt(left) 0x38 */ 56
+#define KEY_Space /* (SpaceBar) 0x39 */ 57
+#define KEY_CapsLock /* CapsLock 0x3a */ 58
+#define KEY_F1 /* F1 0x3b */ 59
+#define KEY_F2 /* F2 0x3c */ 60
+#define KEY_F3 /* F3 0x3d */ 61
+#define KEY_F4 /* F4 0x3e */ 62
+#define KEY_F5 /* F5 0x3f */ 63
+#define KEY_F6 /* F6 0x40 */ 64
+#define KEY_F7 /* F7 0x41 */ 65
+#define KEY_F8 /* F8 0x42 */ 66
+#define KEY_F9 /* F9 0x43 */ 67
+#define KEY_F10 /* F10 0x44 */ 68
+#define KEY_NumLock /* NumLock 0x45 */ 69
+#define KEY_ScrollLock /* ScrollLock 0x46 */ 70
+#define KEY_KP_7 /* 7 Home 0x47 */ 71
+#define KEY_KP_8 /* 8 Up 0x48 */ 72
+#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
+#define KEY_KP_Minus /* - (Minus) 0x4a */ 74
+#define KEY_KP_4 /* 4 Left 0x4b */ 75
+#define KEY_KP_5 /* 5 0x4c */ 76
+#define KEY_KP_6 /* 6 Right 0x4d */ 77
+#define KEY_KP_Plus /* + (Plus) 0x4e */ 78
+#define KEY_KP_1 /* 1 End 0x4f */ 79
+#define KEY_KP_2 /* 2 Down 0x50 */ 80
+#define KEY_KP_3 /* 3 PgDown 0x51 */ 81
+#define KEY_KP_0 /* 0 Insert 0x52 */ 82
+#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
+#define KEY_SysReqest /* SysReqest 0x54 */ 84
+ /* NOTUSED 0x55 */
+#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
+#define KEY_F11 /* F11 0x57 */ 87
+#define KEY_F12 /* F12 0x58 */ 88
+
+#define KEY_Prefix0 /* special 0x60 */ 96
+#define KEY_Prefix1 /* specail 0x61 */ 97
+
+/*
+ * The 'scancodes' below are generated by the server, because the MF101/102
+ * keyboard sends them as sequence of other scancodes
+ */
+#define KEY_Home /* Home 0x59 */ 89
+#define KEY_Up /* Up 0x5a */ 90
+#define KEY_PgUp /* PgUp 0x5b */ 91
+#define KEY_Left /* Left 0x5c */ 92
+#define KEY_Begin /* Begin 0x5d */ 93
+#define KEY_Right /* Right 0x5e */ 94
+#define KEY_End /* End 0x5f */ 95
+#define KEY_Down /* Down 0x60 */ 96
+#define KEY_PgDown /* PgDown 0x61 */ 97
+#define KEY_Insert /* Insert 0x62 */ 98
+#define KEY_Delete /* Delete 0x63 */ 99
+#define KEY_KP_Enter /* Enter 0x64 */ 100
+#define KEY_RCtrl /* Ctrl(right) 0x65 */ 101
+#define KEY_Pause /* Pause 0x66 */ 102
+#define KEY_Print /* Print 0x67 */ 103
+#define KEY_KP_Divide /* Divide 0x68 */ 104
+#define KEY_AltLang /* AtlLang(right) 0x69 */ 105
+#define KEY_Break /* Break 0x6a */ 106
+#define KEY_LMeta /* Left Meta 0x6b */ 107
+#define KEY_RMeta /* Right Meta 0x6c */ 108
+#define KEY_Menu /* Menu 0x6d */ 109
+#define KEY_F13 /* F13 0x6e */ 110
+#define KEY_F14 /* F14 0x6f */ 111
+#define KEY_F15 /* F15 0x70 */ 112
+#define KEY_HKTG /* Hirugana/Katakana tog 0x70 */ 112
+#define KEY_F16 /* F16 0x71 */ 113
+#define KEY_F17 /* F17 0x72 */ 114
+#define KEY_KP_DEC /* KP_DEC 0x73 */ 115
+#define KEY_BSlash2 /* \ _ 0x73 */ 115
+#define KEY_KP_Equal /* Equal (Keypad) 0x76 */ 118
+#define KEY_XFER /* Kanji Transfer 0x79 */ 121
+#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
+#define KEY_Yen /* Yen 0x7d */ 125
+
+#define KEY_Power /* Power Key 0x84 */ 132
+#define KEY_Mute /* Audio Mute 0x85 */ 133
+#define KEY_AudioLower /* Audio Lower 0x86 */ 134
+#define KEY_AudioRaise /* Audio Raise 0x87 */ 135
+#define KEY_Help /* Help 0x88 */ 136
+#define KEY_L1 /* Stop 0x89 */ 137
+#define KEY_L2 /* Again 0x8a */ 138
+#define KEY_L3 /* Props 0x8b */ 139
+#define KEY_L4 /* Undo 0x8c */ 140
+#define KEY_L5 /* Front 0x8d */ 141
+#define KEY_L6 /* Copy 0x8e */ 142
+#define KEY_L7 /* Open 0x8f */ 143
+#define KEY_L8 /* Paste 0x90 */ 144
+#define KEY_L9 /* Find 0x91 */ 145
+#define KEY_L10 /* Cut 0x92 */ 146
+
+/*
+ * Fake 'scancodes' in the following ranges are generated for 2-byte
+ * codes not handled elsewhere. These correspond to most extended keys
+ * on so-called "Internet" keyboards:
+ *
+ * 0x79-0x93
+ * 0x96-0xa1
+ * 0xa3-0xac
+ * 0xb1-0xb4
+ * 0xba-0xbd
+ * 0xc2
+ * 0xcc-0xd2
+ * 0xd6-0xf7
+ */
+
+/*
+ * Remapped 'scancodes' are generated for single-byte codes in the range
+ * 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards.
+ */
+
+#define KEY_0x59 0x95
+#define KEY_0x5A 0xA2
+#define KEY_0x5B 0xAD
+#define KEY_0x5C KEY_KP_EQUAL
+#define KEY_0x5D 0xAE
+#define KEY_0x5E 0xAF
+#define KEY_0x5F 0xB0
+#define KEY_0x62 0xB5
+#define KEY_0x63 0xB6
+#define KEY_0x64 0xB7
+#define KEY_0x65 0xB8
+#define KEY_0x66 0xB9
+#define KEY_0x67 0xBE
+#define KEY_0x68 0xBF
+#define KEY_0x69 0xC0
+#define KEY_0x6A 0xC1
+#define KEY_0x6B 0xC3
+#define KEY_0x6C 0xC4
+#define KEY_0x6D 0xC5
+#define KEY_0x6E 0xC6
+#define KEY_0x6F 0xC7
+#define KEY_0x70 0xC8
+#define KEY_0x71 0xC9
+#define KEY_0x72 0xCA
+#define KEY_0x73 0xCB
+#define KEY_0x74 0xD3
+#define KEY_0x75 0xD4
+#define KEY_0x76 0xD5
+
+/* These are for "notused" and "unknown" entries in translation maps. */
+#define KEY_NOTUSED 0
+#define KEY_UNKNOWN 255
+
+#endif /* _ATKEYNAMES_H */
diff --git a/xorg-server/hw/dmx/input/dmxbackend.c b/xorg-server/hw/dmx/input/dmxbackend.c
index b1791098a..b94c6d468 100644
--- a/xorg-server/hw/dmx/input/dmxbackend.c
+++ b/xorg-server/hw/dmx/input/dmxbackend.c
@@ -104,8 +104,7 @@ typedef struct _myPrivate {
pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice)
{
GETDMXLOCALFROMPDEVICE;
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->dmxLocal = dmxLocal;
return priv;
}
@@ -115,7 +114,7 @@ pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice)
* #dmxBackendCreatePrivate. */
void dmxBackendDestroyPrivate(pointer private)
{
- if (private) xfree(private);
+ if (private) free(private);
}
static void *dmxBackendTestScreen(DMXScreenInfo *dmxScreen, void *closure)
diff --git a/xorg-server/hw/dmx/input/dmxcommon.h b/xorg-server/hw/dmx/input/dmxcommon.h
index 1cc935d0b..a9b260cd9 100644
--- a/xorg-server/hw/dmx/input/dmxcommon.h
+++ b/xorg-server/hw/dmx/input/dmxcommon.h
@@ -63,13 +63,9 @@
#define DMX_COMMON_XKB DMX_COMMON_OTHER
#endif
-#ifdef XINPUT
#define DMX_COMMON_PRIVATE \
DMX_COMMON_XKB; \
XDevice *xi
-#else
-#define DMX_COMMON_PRIVATE DMX_COMMON_OTHER
-#endif
#define GETONLYPRIVFROMPRIVATE \
myPrivate *priv = private
diff --git a/xorg-server/hw/dmx/input/dmxconsole.c b/xorg-server/hw/dmx/input/dmxconsole.c
index b2a2ec302..9542efacd 100644
--- a/xorg-server/hw/dmx/input/dmxconsole.c
+++ b/xorg-server/hw/dmx/input/dmxconsole.c
@@ -140,8 +140,7 @@ static int unscaley(myPrivate *priv, int y)
pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice)
{
GETDMXLOCALFROMPDEVICE;
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->dmxLocal = dmxLocal;
return priv;
}
@@ -149,7 +148,7 @@ pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice)
/** If \a private is non-NULL, free its associated memory. */
void dmxConsoleDestroyPrivate(pointer private)
{
- if (private) xfree(private);
+ if (private) free(private);
}
static void dmxConsoleDrawFineCursor(myPrivate *priv, XRectangle *rect)
diff --git a/xorg-server/hw/dmx/input/dmxeq.c b/xorg-server/hw/dmx/input/dmxeq.c
index dff0b4423..86ba960b8 100644
--- a/xorg-server/hw/dmx/input/dmxeq.c
+++ b/xorg-server/hw/dmx/input/dmxeq.c
@@ -79,10 +79,8 @@
#include "inputstr.h"
#include "scrnintstr.h" /* For screenInfo */
-#ifdef XINPUT
#include <X11/extensions/XIproto.h>
#define EXTENSION_PROC_ARGS void *
-#endif
#if DMX_EQ_DEBUG
#define DMXDBG2(f,a,b) dmxLog(dmxDebug,f,a,b)
@@ -100,9 +98,8 @@
typedef struct _Event {
xEvent event; /**< Event. */
ScreenPtr pScreen; /**< Screen on which event occurred. */
-#ifdef XINPUT
deviceValuator valuator; /**< XInput device valuator information. */
-#endif
+ DeviceIntPtr pDev;
} EventRec, *EventPtr;
/** Event queue. */
@@ -158,7 +155,7 @@ Bool dmxeqInit(DevicePtr pKbd, DevicePtr pPtr)
* called from regular code.
*/
-void dmxeqEnqueue(xEvent *e)
+void dmxeqEnqueue(DeviceIntPtr pDev, xEvent *e)
{
HWEventQueueType oldtail, newtail;
Bool isMotion;
@@ -183,15 +180,12 @@ void dmxeqEnqueue(xEvent *e)
/* Store the event in the queue */
dmxEventQueue.events[oldtail].event = *e;
-#ifdef XINPUT
- {
- /* If this is an XInput event, store the
- * valuator event, too */
- deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)e;
- if (e->u.u.type >= LASTEvent && (ev->deviceid & MORE_EVENTS))
- dmxEventQueue.events[oldtail].valuator = *(deviceValuator *)(ev+1);
- }
-#endif
+ dmxEventQueue.events[oldtail].pDev = pDev;
+ /* If this is an XInput event, store the
+ * valuator event, too */
+ deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)e;
+ if (e->u.u.type >= LASTEvent && (ev->deviceid & MORE_EVENTS))
+ dmxEventQueue.events[oldtail].valuator = *(deviceValuator *)(ev+1);
/* Make sure that event times don't go
* backwards - this is "unnecessary",
@@ -205,13 +199,12 @@ void dmxeqEnqueue(xEvent *e)
/** Make \a pScreen the new screen for enqueueing events. If \a fromDIX
* is TRUE, also make \a pScreen the new screen for dequeuing events. */
-void dmxeqSwitchScreen(ScreenPtr pScreen, Bool fromDIX)
+void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX)
{
dmxEventQueue.pEnqueueScreen = pScreen;
if (fromDIX) dmxEventQueue.pDequeueScreen = pScreen;
}
-#ifdef XINPUT
static void dmxeqProcessXInputEvent(xEvent *xe, EventRec *e)
{
deviceKeyButtonPointer *ev = (deviceKeyButtonPointer *)xe;
@@ -238,7 +231,6 @@ static void dmxeqProcessXInputEvent(xEvent *xe, EventRec *e)
pDevice->public.processInputProc(xe, pDevice, 1);
}
}
-#endif
/**
* This function is called from #ProcessInputEvents() to remove events
@@ -268,7 +260,7 @@ void dmxeqProcessInputEvents(void)
y = e->event.u.keyButtonPointer.rootY;
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
else ++dmxEventQueue.head;
- NewCurrentScreen(dmxEventQueue.pDequeueScreen, x, y);
+ NewCurrentScreen(e->pDev, dmxEventQueue.pDequeueScreen, x, y);
} else {
xe[0] = e->event;
if (dmxEventQueue.head == QUEUE_SIZE - 1) dmxEventQueue.head = 0;
@@ -285,11 +277,8 @@ void dmxeqProcessInputEvents(void)
(DeviceIntPtr)dmxEventQueue.pKbd, 1);
break;
default:
-#ifdef XINPUT
dmxeqProcessXInputEvent(xe, e);
break;
-#endif
- /* ifndef XINPUT, fall through */
case ButtonPress:
case ButtonRelease:
case MotionNotify:
diff --git a/xorg-server/hw/dmx/input/dmxevents.c b/xorg-server/hw/dmx/input/dmxevents.c
index 26dc067dc..24275a189 100644
--- a/xorg-server/hw/dmx/input/dmxevents.c
+++ b/xorg-server/hw/dmx/input/dmxevents.c
@@ -57,9 +57,7 @@
#include "mipointer.h"
#include "mi.h"
-#ifdef XINPUT
#include "XIstubs.h"
-#endif
static int dmxGlobalX, dmxGlobalY; /* Global cursor position */
static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
@@ -154,7 +152,6 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
return 0;
}
-#ifdef XINPUT
static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
DMXBlockType block)
{
@@ -204,11 +201,10 @@ static void dmxEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, xEvent *e,
if (block)
dmxSigioBlock();
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
}
-#endif
DMXScreenInfo *dmxFindFirstScreen(int x, int y)
{
@@ -231,15 +227,16 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
- xEvent *events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ EventListPtr events;
int detail = 0; /* XXX should this be mask of pressed buttons? */
valuators[0] = x;
valuators[1] = y;
+
+ GetEventList(&events);
nevents = GetPointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE, 0, 2, valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
}
@@ -331,7 +328,6 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
-#ifdef XINPUT
#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
int *v, int firstAxis, int axesCount,
@@ -424,7 +420,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
if (block)
dmxSigioBlock();
dmxPointerPutMotionEvent(pDevice, firstAxis, axesCount, v, xev->time);
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
}
@@ -439,6 +435,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
int event = -1;
XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
if (!e)
return -1; /* No extended event passed, cannot handle */
@@ -504,7 +501,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
if (block)
dmxSigioBlock();
- dmxeqEnqueue(xE);
+ dmxeqEnqueue(pDevice, xE);
if (block)
dmxSigioUnblock();
break;
@@ -537,7 +534,6 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
}
return 0;
}
-#endif
static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
{
@@ -578,14 +574,12 @@ void dmxInvalidateGlobalPosition(void)
void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
DMXMotionType type, DMXBlockType block)
{
-#ifdef XINPUT
GETDMXLOCALFROMPDEV;
if (!dmxLocal->sendsCore) {
dmxExtMotion(dmxLocal, v, firstAxes, axesCount, type, block);
return;
}
-#endif
if (axesCount == 2) {
switch (type) {
case DMX_RELATIVE:
@@ -682,7 +676,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
xEvent xE;
DeviceIntPtr p = dmxLocal->pDevice;
int i, nevents, valuators[3];
- xEvent *events;
+ EventListPtr events;
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
@@ -696,38 +690,35 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
- events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ GetEventList(&events);
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
nevents = GetKeyboardEvents(events, p, type, detail);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
case ButtonPress:
case ButtonRelease:
detail = dmxGetButtonMapping(dmxLocal, detail);
- events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ GetEventList(&events);
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE,
0, /* first_valuator = 0 */
0, /* num_valuators = 0 */
valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
case MotionNotify:
- events = Xcalloc(sizeof(xEvent), GetMaximumEventsNum());
+ GetEventList(&events);
valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y;
valuators[2] = e->xmotion.state;
nevents = GetPointerEvents(events, p, type, detail,
POINTER_ABSOLUTE, 0, 3, valuators);
for (i = 0; i < nevents; i++)
- mieqEnqueue(p, events + i);
- xfree(events);
+ mieqEnqueue(p, (events + i)->event);
return;
case EnterNotify:
@@ -739,17 +730,13 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
* control of the input device LEDs. */
return;
default:
-#ifdef XINPUT
if (type == ProximityIn || type == ProximityOut) {
if (dmxLocal->sendsCore)
return; /* Not a core event */
break;
}
-#endif
if (type >= LASTEvent) {
-#ifdef XINPUT
if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block))
-#endif
dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type);
} else {
dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n",
@@ -764,11 +751,9 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
xE.u.u.detail = detail;
xE.u.keyButtonPointer.time = GetTimeInMillis();
-#ifdef XINPUT
if (!dmxLocal->sendsCore)
dmxEnqueueExtEvent(dmxLocal, &xE, block);
else
-#endif
dmxeqEnqueue(&xE);
#endif /*00*/
}
diff --git a/xorg-server/hw/dmx/input/dmxinputinit.c b/xorg-server/hw/dmx/input/dmxinputinit.c
index fd4eeaacb..77f8ed5fc 100644
--- a/xorg-server/hw/dmx/input/dmxinputinit.c
+++ b/xorg-server/hw/dmx/input/dmxinputinit.c
@@ -73,13 +73,11 @@
#include "windowstr.h"
#include "mi.h"
-#ifdef XINPUT
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "exevents.h"
#define EXTENSION_PROC_ARGS void *
#include "extinit.h"
-#endif
/* From XI.h */
#ifndef Relative
@@ -462,9 +460,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
GETDMXINPUTFROMPDEVICE;
int fd;
DMXLocalInitInfo info;
-#ifdef XINPUT
int i;
-#endif
if (dmxInput->detached) return Success;
@@ -480,15 +476,11 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
break;
}
if (info.keyClass) {
-#if 00 /*BP*/
- InitKeyClassDeviceStruct(pDevice, &info.keySyms, info.modMap);
-#else
DevicePtr pDev = (DevicePtr) pDevice;
InitKeyboardDeviceStruct(pDev,
&info.keySyms,
info.modMap,
dmxBell, dmxKbdCtrl);
-#endif
}
if (info.buttonClass) {
InitButtonClassDeviceStruct(pDevice, info.numButtons, info.map);
@@ -496,49 +488,33 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
if (info.valuatorClass) {
if (info.numRelAxes && dmxLocal->sendsCore) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
-#if 00 /*BP*/
- miPointerGetMotionEvents,
- miPointerGetMotionBufferSize(),
-#else
- GetMotionHistory,
GetMaximumEventsNum(),
-#endif
Relative);
-#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
-#endif
} else if (info.numRelAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
- dmxPointerGetMotionEvents,
dmxPointerGetMotionBufferSize(),
Relative);
-#ifdef XINPUT
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, info.minval[0],
info.maxval[0], info.res[0],
info.minres[0], info.maxres[0]);
-#endif
} else if (info.numAbsAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes,
- dmxPointerGetMotionEvents,
dmxPointerGetMotionBufferSize(),
Absolute);
-#ifdef XINPUT
for (i = 0; i < info.numAbsAxes; i++)
InitValuatorAxisStruct(pDevice, i+info.numRelAxes,
info.minval[i+1], info.maxval[i+1],
info.res[i+1], info.minres[i+1],
info.maxres[i+1]);
-#endif
}
}
if (info.focusClass) InitFocusClassDeviceStruct(pDevice);
-#ifdef XINPUT
if (info.proximityClass) InitProximityClassDeviceStruct(pDevice);
-#endif
if (info.ptrFeedbackClass)
InitPtrFeedbackClassDeviceStruct(pDevice, dmxChangePointerControl);
if (info.kbdFeedbackClass)
@@ -759,22 +735,15 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
}
}
-#ifdef XINPUT
if (!name) {
name = "extension";
registerProcPtr = RegisterOtherDevice;
}
-#else
- if (!name)
- dmxLog(dmxFatal,
- "Server not build with XINPUT support (cannot add %s)\n",
- dmxLocal->name);
-#endif
if (!name || !registerProcPtr)
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
- pDevice = AddInputDevice(dmxDeviceOnOff, TRUE);
+ pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
if (!pDevice) {
dmxLog(dmxError, "Too many devices -- cannot add device %s\n",
dmxLocal->name);
@@ -914,9 +883,11 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
for (i = 0; i < num; i++) {
const char *use = "Unknown";
switch (devices[i].use) {
- case IsXPointer: use = "XPointer"; break;
- case IsXKeyboard: use = "XKeyboard"; break;
- case IsXExtensionDevice: use = "XExtensionDevice"; break;
+ case IsXPointer: use = "XPointer"; break;
+ case IsXKeyboard: use = "XKeyboard"; break;
+ case IsXExtensionDevice: use = "XExtensionDevice"; break;
+ case IsXExtensionPointer: use = "XExtensionPointer"; break;
+ case IsXExtensionKeyboard: use = "XExtensionKeyboard"; break;
}
dmxLogInput(dmxInput, " %2d %-10.10s %-16.16s\n",
devices[i].id,
@@ -950,7 +921,10 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
}
}
break;
+#if 0
case IsXExtensionDevice:
+ case IsXExtensionKeyboard:
+ case IsXExtensionPointer:
if (doXI) {
if (!dmxInput->numDevs) {
dmxLog(dmxWarning,
@@ -969,6 +943,7 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
}
}
break;
+#endif
}
}
XFreeDeviceList(devices);
@@ -1104,13 +1079,6 @@ void dmxInputInit(DMXInputInfo *dmxInput)
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
-#ifndef XINPUT
- if (!dmxLocal->isCore)
- dmxLog(dmxFatal,
- "This server was not compiled to support the XInput"
- " extension, but %s is not a core device.\n",
- dmxLocal->name);
-#endif
dmxLocal->pDevice = dmxAddDevice(dmxLocal);
if (dmxLocal->isCore) {
if (dmxLocal->type == DMX_LOCAL_MOUSE)
diff --git a/xorg-server/hw/dmx/input/dmxmotion.c b/xorg-server/hw/dmx/input/dmxmotion.c
index cc55eedff..73580a215 100644
--- a/xorg-server/hw/dmx/input/dmxmotion.c
+++ b/xorg-server/hw/dmx/input/dmxmotion.c
@@ -113,8 +113,7 @@ void dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
* DMX_MOTION_SIZE);
dmxLocal->head = 0;
dmxLocal->tail = 0;
- dmxLocal->valuators = xalloc(sizeof(*dmxLocal->valuators) * numAxes);
- memset(dmxLocal->valuators, 0, sizeof(*dmxLocal->valuators) * numAxes);
+ dmxLocal->valuators = calloc(sizeof(*dmxLocal->valuators), numAxes);
} else {
if (++dmxLocal->tail >= DMX_MOTION_SIZE) dmxLocal->tail = 0;
if (dmxLocal->head == dmxLocal->tail)
diff --git a/xorg-server/hw/dmx/input/dmxxinput.c b/xorg-server/hw/dmx/input/dmxxinput.c
index 97bea7596..97f43927a 100644
--- a/xorg-server/hw/dmx/input/dmxxinput.c
+++ b/xorg-server/hw/dmx/input/dmxxinput.c
@@ -93,18 +93,10 @@ int ChangePointerDevice(DeviceIntPtr old_dev,
/* Switch the motion history buffers */
if (dmxLocalOld->savedMotionProc) {
- old_dev->valuator->GetMotionProc = dmxLocalOld->savedMotionProc;
old_dev->valuator->numMotionEvents = dmxLocalOld->savedMotionEvents;
}
- dmxLocalNew->savedMotionProc = new_dev->valuator->GetMotionProc;
dmxLocalNew->savedMotionEvents = new_dev->valuator->numMotionEvents;
-#if 00 /*BP*/
- new_dev->valuator->GetMotionProc = miPointerGetMotionEvents;
- new_dev->valuator->numMotionEvents = miPointerGetMotionBufferSize();
-#else
- new_dev->valuator->GetMotionProc = GetMotionHistory;
new_dev->valuator->numMotionEvents = GetMaximumEventsNum();
-#endif
/* Switch our notion of core pointer */
dmxLocalOld->isCore = 0;
dmxLocalOld->sendsCore = dmxLocalOld->savedSendsCore;
diff --git a/xorg-server/hw/dmx/input/lnx-keyboard.c b/xorg-server/hw/dmx/input/lnx-keyboard.c
index 42a807b11..55ff9f859 100644
--- a/xorg-server/hw/dmx/input/lnx-keyboard.c
+++ b/xorg-server/hw/dmx/input/lnx-keyboard.c
@@ -358,8 +358,7 @@ static unsigned char at2lnx[NUM_KEYCODES] =
/** Create a private structure for use within this file. */
pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
{
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->fd = -1;
priv->pKeyboard = pKeyboard;
return priv;
@@ -368,7 +367,7 @@ pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
/** Destroy a private structure. */
void kbdLinuxDestroyPrivate(pointer priv)
{
- if (priv) xfree(priv);
+ if (priv) free(priv);
}
/** Ring the bell.
diff --git a/xorg-server/hw/dmx/input/lnx-ms.c b/xorg-server/hw/dmx/input/lnx-ms.c
index b3692a071..549df46e2 100644
--- a/xorg-server/hw/dmx/input/lnx-ms.c
+++ b/xorg-server/hw/dmx/input/lnx-ms.c
@@ -292,8 +292,7 @@ void msLinuxVTPostSwitch(pointer p)
/** Create a private structure for use within this file. */
pointer msLinuxCreatePrivate(DeviceIntPtr pMouse)
{
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->fd = -1;
priv->pMouse = pMouse;
return priv;
@@ -302,7 +301,7 @@ pointer msLinuxCreatePrivate(DeviceIntPtr pMouse)
/** Destroy a private structure. */
void msLinuxDestroyPrivate(pointer priv)
{
- if (priv) xfree(priv);
+ if (priv) free(priv);
}
/** Fill the \a info structure with information needed to initialize \a
diff --git a/xorg-server/hw/dmx/input/lnx-ps2.c b/xorg-server/hw/dmx/input/lnx-ps2.c
index 8b906df5f..70918eef4 100644
--- a/xorg-server/hw/dmx/input/lnx-ps2.c
+++ b/xorg-server/hw/dmx/input/lnx-ps2.c
@@ -260,8 +260,7 @@ void ps2LinuxVTPostSwitch(pointer p)
/** Create a private structure for use within this file. */
pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse)
{
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->fd = -1;
priv->pMouse = pMouse;
return priv;
@@ -270,7 +269,7 @@ pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse)
/** Destroy a private structure. */
void ps2LinuxDestroyPrivate(pointer priv)
{
- if (priv) xfree(priv);
+ if (priv) free(priv);
}
/** Fill the \a info structure with information needed to initialize \a
diff --git a/xorg-server/hw/dmx/input/usb-common.c b/xorg-server/hw/dmx/input/usb-common.c
index 70695d0f1..2d3f4dd5f 100644
--- a/xorg-server/hw/dmx/input/usb-common.c
+++ b/xorg-server/hw/dmx/input/usb-common.c
@@ -368,8 +368,7 @@ void usbOff(DevicePtr pDev)
/** Create a private structure for use within this file. */
pointer usbCreatePrivate(DeviceIntPtr pDevice)
{
- myPrivate *priv = xalloc(sizeof(*priv));
- memset(priv, 0, sizeof(*priv));
+ myPrivate *priv = calloc(1, sizeof(*priv));
priv->fd = -1;
priv->pDevice = pDevice;
return priv;
@@ -378,5 +377,5 @@ pointer usbCreatePrivate(DeviceIntPtr pDevice)
/** Destroy a private structure. */
void usbDestroyPrivate(pointer priv)
{
- if (priv) xfree(priv);
+ if (priv) free(priv);
}