aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-26 08:58:03 +0000
committermarha <marha@users.sourceforge.net>2010-05-26 08:58:03 +0000
commite60ed91097aa7511581b6c53b9e4b14aaf1027b5 (patch)
treec8ce06db36103141858e95febad857ca989e7ad0 /xorg-server/hw
parentfb91c8589937f1a9aba5d5a4e0de98c381dfe9b8 (diff)
parentfade1b113f18f3fd26c3c01ca4543effa80b9b62 (diff)
downloadvcxsrv-e60ed91097aa7511581b6c53b9e4b14aaf1027b5.tar.gz
vcxsrv-e60ed91097aa7511581b6c53b9e4b14aaf1027b5.tar.bz2
vcxsrv-e60ed91097aa7511581b6c53b9e4b14aaf1027b5.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/dmx/dmxinput.c238
-rw-r--r--xorg-server/hw/kdrive/linux/evdev.c4
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Module.h424
-rw-r--r--xorg-server/hw/xfree86/common/xf86Option.c4
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c11
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.h439
-rw-r--r--xorg-server/hw/xfree86/common/xf86str.h1
-rw-r--r--xorg-server/hw/xnest/Cursor.c3
-rw-r--r--xorg-server/hw/xquartz/darwinXinput.c514
10 files changed, 824 insertions, 816 deletions
diff --git a/xorg-server/hw/dmx/dmxinput.c b/xorg-server/hw/dmx/dmxinput.c
index 568bb882b..0f7f24040 100644
--- a/xorg-server/hw/dmx/dmxinput.c
+++ b/xorg-server/hw/dmx/dmxinput.c
@@ -1,119 +1,119 @@
-/*
- * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * 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 on 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 (including the
- * next paragraph) 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
- * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * 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.
- */
-
-/*
- * Authors:
- * David H. Dawes <dawes@xfree86.org>
- * Kevin E. Martin <kem@redhat.com>
- * Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-
-/** \file
- * Provide the main entry points for input initialization and processing
- * that arequired by the dix layer.
- */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "dmx.h"
-#include "dmxlog.h"
-#include "dmxinput.h"
-
-#include "inputstr.h"
-#include "input.h"
-#include "mi.h"
-
-/** Returns TRUE if the key is a valid modifier. For PC-class
- * keyboards, all keys can be used as modifiers, so return TRUE
- * always. */
-Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
-/** Called from dix/main.c on each server generation to initialize
- * inputs. All the work is done in dmxInputInit. \see
- * dmxInputInit() */
-void InitInput(int argc, char **argv)
-{
- int i;
- DMXInputInfo *dmxInput;
-
- if (!dmxNumInputs)
- dmxLog(dmxFatal, "InitInput: no inputs specified\n");
-
- for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
- dmxInputInit(dmxInput);
-
- mieqInit();
-}
-
-void CloseInput(void)
-{
-}
-
-/** Called from dix/dispatch.c in Dispatch() whenever input events
- * require processing. All the work is done in the lower level
- * routines. */
-void ProcessInputEvents(void)
-{
- int i;
- DMXInputInfo *dmxInput;
-
- for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
- if (!dmxInput->detached && dmxInput->processInputEvents)
- dmxInput->processInputEvents(dmxInput);
-}
-
-/** This routine is called from \a dmxwindow.c whenever the layout of
- * windows on the display might have changed. This information is used
- * by input drivers (currently only the console driver) that provide
- * information about window layout to the user. */
-void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
-{
- int i;
- DMXInputInfo *dmxInput;
-
- for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
- if (!dmxInput->detached && dmxInput->updateWindowInfo)
- dmxInput->updateWindowInfo(dmxInput, type, pWindow);
-}
-
-int
-NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
- DeviceIntPtr *pdev)
-{
- return BadRequest;
-}
-
-void
-DeleteInputDeviceRequest(DeviceIntPtr pDev)
-{
-}
+/*
+ * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * 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 on 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 (including the
+ * next paragraph) 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
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/*
+ * Authors:
+ * David H. Dawes <dawes@xfree86.org>
+ * Kevin E. Martin <kem@redhat.com>
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * Provide the main entry points for input initialization and processing
+ * that arequired by the dix layer.
+ */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#include "dmx.h"
+#include "dmxlog.h"
+#include "dmxinput.h"
+
+#include "inputstr.h"
+#include "input.h"
+#include "mi.h"
+
+/** Returns TRUE if the key is a valid modifier. For PC-class
+ * keyboards, all keys can be used as modifiers, so return TRUE
+ * always. */
+Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
+{
+ return TRUE;
+}
+
+/** Called from dix/main.c on each server generation to initialize
+ * inputs. All the work is done in dmxInputInit. \see
+ * dmxInputInit() */
+void InitInput(int argc, char **argv)
+{
+ int i;
+ DMXInputInfo *dmxInput;
+
+ if (!dmxNumInputs)
+ dmxLog(dmxFatal, "InitInput: no inputs specified\n");
+
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
+ dmxInputInit(dmxInput);
+
+ mieqInit();
+}
+
+void CloseInput(void)
+{
+}
+
+/** Called from dix/dispatch.c in Dispatch() whenever input events
+ * require processing. All the work is done in the lower level
+ * routines. */
+void ProcessInputEvents(void)
+{
+ int i;
+ DMXInputInfo *dmxInput;
+
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
+ if (!dmxInput->detached && dmxInput->processInputEvents)
+ dmxInput->processInputEvents(dmxInput);
+}
+
+/** This routine is called from \a dmxwindow.c whenever the layout of
+ * windows on the display might have changed. This information is used
+ * by input drivers (currently only the console driver) that provide
+ * information about window layout to the user. */
+void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
+{
+ int i;
+ DMXInputInfo *dmxInput;
+
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
+ if (!dmxInput->detached && dmxInput->updateWindowInfo)
+ dmxInput->updateWindowInfo(dmxInput, type, pWindow);
+}
+
+int
+NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
+ DeviceIntPtr *pdev)
+{
+ return BadRequest;
+}
+
+void
+DeleteInputDeviceRequest(DeviceIntPtr pDev, int flags)
+{
+}
diff --git a/xorg-server/hw/kdrive/linux/evdev.c b/xorg-server/hw/kdrive/linux/evdev.c
index 20df77b99..71b93931b 100644
--- a/xorg-server/hw/kdrive/linux/evdev.c
+++ b/xorg-server/hw/kdrive/linux/evdev.c
@@ -165,7 +165,7 @@ EvdevPtrRead (int evdevPort, void *closure)
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
if (n <= 0) {
if (errno == ENODEV)
- DeleteInputDeviceRequest(pi->dixdev);
+ DeleteInputDeviceRequest(pi->dixdev, 0);
return;
}
@@ -375,7 +375,7 @@ EvdevKbdRead (int evdevPort, void *closure)
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
if (n <= 0) {
if (errno == ENODEV)
- DeleteInputDeviceRequest(ki->dixdev);
+ DeleteInputDeviceRequest(ki->dixdev, 0);
return;
}
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index 1b9bd1f1e..0fa695a3a 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -330,6 +330,8 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
if (pInp->private)
free(pInp->private);
+ FreeInputAttributes(pInp->attrs);
+
/* Remove the entry from the list. */
if (pInp == xf86InputDevs)
xf86InputDevs = pInp->next;
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h
index d61758f78..f85c54dc9 100644
--- a/xorg-server/hw/xfree86/common/xf86Module.h
+++ b/xorg-server/hw/xfree86/common/xf86Module.h
@@ -1,212 +1,212 @@
-/*
- * Copyright (c) 1997-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).
- */
-
-/*
- * This file contains the parts of the loader interface that are visible
- * to modules. This is the only loader-related header that modules should
- * include.
- *
- * It should include a bare minimum of other headers.
- *
- * Longer term, the module/loader code should probably live directly under
- * Xserver/.
- *
- * XXX This file arguably belongs in xfree86/loader/.
- */
-
-#ifndef _XF86MODULE_H
-#define _XF86MODULE_H
-
-#include "misc.h"
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-typedef enum {
- LD_RESOLV_IFDONE = 0, /* only check if no more
- delays pending */
- LD_RESOLV_NOW = 1, /* finish one delay step */
- LD_RESOLV_FORCE = 2 /* force checking... */
-} LoaderResolveOptions;
-
-#define DEFAULT_LIST ((char *)-1)
-
-/* This indicates a special module that doesn't have the usual entry point */
-#define EXTERN_MODULE ((pointer)-1)
-
-/* Built-in ABI classes. These definitions must not be changed. */
-#define ABI_CLASS_NONE NULL
-#define ABI_CLASS_ANSIC "X.Org ANSI C Emulation"
-#define ABI_CLASS_VIDEODRV "X.Org Video Driver"
-#define ABI_CLASS_XINPUT "X.Org XInput driver"
-#define ABI_CLASS_EXTENSION "X.Org Server Extension"
-#define ABI_CLASS_FONT "X.Org Font Renderer"
-
-#define ABI_MINOR_MASK 0x0000FFFF
-#define ABI_MAJOR_MASK 0xFFFF0000
-#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
-#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
-#define SET_ABI_VERSION(maj, min) \
- ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
-
-/*
- * ABI versions. Each version has a major and minor revision. Modules
- * using lower minor revisions must work with servers of a higher minor
- * revision. There is no compatibility between different major revisions.
- * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
- * changed. The minor revision mask is 0x0000FFFF and the major revision
- * mask is 0xFFFF0000.
- */
-#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(10, 0)
-#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
-#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
-
-#define MODINFOSTRING1 0xef23fdc5
-#define MODINFOSTRING2 0x10dc023a
-
-#ifndef MODULEVENDORSTRING
-#define MODULEVENDORSTRING "X.Org Foundation"
-#endif
-
-/* Error return codes for errmaj. New codes must only be added at the end. */
-typedef enum {
- LDR_NOERROR = 0,
- LDR_NOMEM, /* memory allocation failed */
- LDR_NOENT, /* Module file does not exist */
- LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
- LDR_NOSPACE, /* internal module array full */
- LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
- LDR_UNKTYPE, /* file is not a recognized module type */
- LDR_NOLOAD, /* type specific loader failed */
- LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
- LDR_NOPORTOPEN, /* could not open port (check errmin) */
- LDR_NOHARDWARE, /* could not query/initialize the hardware device */
- LDR_MISMATCH, /* the module didn't match the spec'd requirments */
- LDR_BADUSAGE, /* LoadModule is called with bad arguments */
- LDR_INVALID, /* The module doesn't have a valid ModuleData object */
- LDR_BADOS, /* The module doesn't support the OS */
- LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
-} LoaderErrorCode;
-
-/*
- * Some common module classes. The moduleclass can be used to identify
- * that modules loaded are of the correct type. This is a finer
- * classification than the ABI classes even though the default set of
- * classes have the same names. For example, not all modules that require
- * the video driver ABI are themselves video drivers.
- */
-#define MOD_CLASS_NONE NULL
-#define MOD_CLASS_VIDEODRV "X.Org Video Driver"
-#define MOD_CLASS_XINPUT "X.Org XInput Driver"
-#define MOD_CLASS_FONT "X.Org Font Renderer"
-#define MOD_CLASS_EXTENSION "X.Org Server Extension"
-
-/* This structure is expected to be returned by the initfunc */
-typedef struct {
- const char * modname; /* name of module, e.g. "foo" */
- const char * vendor; /* vendor specific string */
- CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
- CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
- CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
- CARD8 majorversion; /* module-specific major version */
- CARD8 minorversion; /* module-specific minor version */
- CARD16 patchlevel; /* module-specific patch level */
- const char * abiclass; /* ABI class that the module uses */
- CARD32 abiversion; /* ABI version */
- const char * moduleclass; /* module class description */
- CARD32 checksum[4]; /* contains a digital signature of the */
- /* version info structure */
-} XF86ModuleVersionInfo;
-
-/*
- * This structure can be used to callers of LoadModule and LoadSubModule to
- * specify version and/or ABI requirements.
- */
-typedef struct {
- CARD8 majorversion; /* module-specific major version */
- CARD8 minorversion; /* moudle-specific minor version */
- CARD16 patchlevel; /* module-specific patch level */
- const char * abiclass; /* ABI class that the module uses */
- CARD32 abiversion; /* ABI version */
- const char * moduleclass; /* module class */
-} XF86ModReqInfo;
-
-/* values to indicate unspecified fields in XF86ModReqInfo. */
-#define MAJOR_UNSPEC 0xFF
-#define MINOR_UNSPEC 0xFF
-#define PATCH_UNSPEC 0xFFFF
-#define ABI_VERS_UNSPEC 0xFFFFFFFF
-
-#define MODULE_VERSION_NUMERIC(maj, min, patch) \
- ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
-#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
-#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
-#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
-
-#define INITARGS void
-
-typedef void (*InitExtension)(INITARGS);
-
-typedef struct {
- InitExtension initFunc;
- const char * name;
- Bool *disablePtr;
- InitExtension setupFunc;
- const char ** initDependencies;
-} ExtensionModule;
-
-extern _X_EXPORT ExtensionModule *ExtensionModuleList;
-
-/* Prototypes for Loader functions that are exported to modules */
-extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **,
- const char **, pointer, const XF86ModReqInfo *,
- int *, int *);
-extern _X_EXPORT void UnloadSubModule(pointer);
-extern _X_EXPORT void UnloadModule (pointer);
-extern _X_EXPORT pointer LoaderSymbol(const char *);
-extern _X_EXPORT char **LoaderListDirs(const char **, const char **);
-extern _X_EXPORT void LoaderFreeDirList(char **);
-extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
-extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool);
-extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
-extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
-extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
-
-typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
-typedef void (*ModuleTearDownProc)(pointer);
-#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
-#define MODULETEARDOWNPROTO(func) void func(pointer)
-
-typedef struct {
- XF86ModuleVersionInfo * vers;
- ModuleSetupProc setup;
- ModuleTearDownProc teardown;
-} XF86ModuleData;
-
-#endif /* _XF86STR_H */
+/*
+ * Copyright (c) 1997-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).
+ */
+
+/*
+ * This file contains the parts of the loader interface that are visible
+ * to modules. This is the only loader-related header that modules should
+ * include.
+ *
+ * It should include a bare minimum of other headers.
+ *
+ * Longer term, the module/loader code should probably live directly under
+ * Xserver/.
+ *
+ * XXX This file arguably belongs in xfree86/loader/.
+ */
+
+#ifndef _XF86MODULE_H
+#define _XF86MODULE_H
+
+#include "misc.h"
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+typedef enum {
+ LD_RESOLV_IFDONE = 0, /* only check if no more
+ delays pending */
+ LD_RESOLV_NOW = 1, /* finish one delay step */
+ LD_RESOLV_FORCE = 2 /* force checking... */
+} LoaderResolveOptions;
+
+#define DEFAULT_LIST ((char *)-1)
+
+/* This indicates a special module that doesn't have the usual entry point */
+#define EXTERN_MODULE ((pointer)-1)
+
+/* Built-in ABI classes. These definitions must not be changed. */
+#define ABI_CLASS_NONE NULL
+#define ABI_CLASS_ANSIC "X.Org ANSI C Emulation"
+#define ABI_CLASS_VIDEODRV "X.Org Video Driver"
+#define ABI_CLASS_XINPUT "X.Org XInput driver"
+#define ABI_CLASS_EXTENSION "X.Org Server Extension"
+#define ABI_CLASS_FONT "X.Org Font Renderer"
+
+#define ABI_MINOR_MASK 0x0000FFFF
+#define ABI_MAJOR_MASK 0xFFFF0000
+#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
+#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
+#define SET_ABI_VERSION(maj, min) \
+ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
+
+/*
+ * ABI versions. Each version has a major and minor revision. Modules
+ * using lower minor revisions must work with servers of a higher minor
+ * revision. There is no compatibility between different major revisions.
+ * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
+ * changed. The minor revision mask is 0x0000FFFF and the major revision
+ * mask is 0xFFFF0000.
+ */
+#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
+#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
+
+#define MODINFOSTRING1 0xef23fdc5
+#define MODINFOSTRING2 0x10dc023a
+
+#ifndef MODULEVENDORSTRING
+#define MODULEVENDORSTRING "X.Org Foundation"
+#endif
+
+/* Error return codes for errmaj. New codes must only be added at the end. */
+typedef enum {
+ LDR_NOERROR = 0,
+ LDR_NOMEM, /* memory allocation failed */
+ LDR_NOENT, /* Module file does not exist */
+ LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
+ LDR_NOSPACE, /* internal module array full */
+ LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
+ LDR_UNKTYPE, /* file is not a recognized module type */
+ LDR_NOLOAD, /* type specific loader failed */
+ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
+ LDR_NOPORTOPEN, /* could not open port (check errmin) */
+ LDR_NOHARDWARE, /* could not query/initialize the hardware device */
+ LDR_MISMATCH, /* the module didn't match the spec'd requirments */
+ LDR_BADUSAGE, /* LoadModule is called with bad arguments */
+ LDR_INVALID, /* The module doesn't have a valid ModuleData object */
+ LDR_BADOS, /* The module doesn't support the OS */
+ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
+} LoaderErrorCode;
+
+/*
+ * Some common module classes. The moduleclass can be used to identify
+ * that modules loaded are of the correct type. This is a finer
+ * classification than the ABI classes even though the default set of
+ * classes have the same names. For example, not all modules that require
+ * the video driver ABI are themselves video drivers.
+ */
+#define MOD_CLASS_NONE NULL
+#define MOD_CLASS_VIDEODRV "X.Org Video Driver"
+#define MOD_CLASS_XINPUT "X.Org XInput Driver"
+#define MOD_CLASS_FONT "X.Org Font Renderer"
+#define MOD_CLASS_EXTENSION "X.Org Server Extension"
+
+/* This structure is expected to be returned by the initfunc */
+typedef struct {
+ const char * modname; /* name of module, e.g. "foo" */
+ const char * vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class description */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+
+/*
+ * This structure can be used to callers of LoadModule and LoadSubModule to
+ * specify version and/or ABI requirements.
+ */
+typedef struct {
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* moudle-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class */
+} XF86ModReqInfo;
+
+/* values to indicate unspecified fields in XF86ModReqInfo. */
+#define MAJOR_UNSPEC 0xFF
+#define MINOR_UNSPEC 0xFF
+#define PATCH_UNSPEC 0xFFFF
+#define ABI_VERS_UNSPEC 0xFFFFFFFF
+
+#define MODULE_VERSION_NUMERIC(maj, min, patch) \
+ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
+#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
+#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
+#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
+
+#define INITARGS void
+
+typedef void (*InitExtension)(INITARGS);
+
+typedef struct {
+ InitExtension initFunc;
+ const char * name;
+ Bool *disablePtr;
+ InitExtension setupFunc;
+ const char ** initDependencies;
+} ExtensionModule;
+
+extern _X_EXPORT ExtensionModule *ExtensionModuleList;
+
+/* Prototypes for Loader functions that are exported to modules */
+extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+extern _X_EXPORT void UnloadSubModule(pointer);
+extern _X_EXPORT void UnloadModule (pointer);
+extern _X_EXPORT pointer LoaderSymbol(const char *);
+extern _X_EXPORT char **LoaderListDirs(const char **, const char **);
+extern _X_EXPORT void LoaderFreeDirList(char **);
+extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
+extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool);
+extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
+extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
+extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
+
+typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
+typedef void (*ModuleTearDownProc)(pointer);
+#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
+#define MODULETEARDOWNPROTO(func) void func(pointer)
+
+typedef struct {
+ XF86ModuleVersionInfo * vers;
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+
+#endif /* _XF86STR_H */
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c
index 9856a6352..d1dcb0f94 100644
--- a/xorg-server/hw/xfree86/common/xf86Option.c
+++ b/xorg-server/hw/xfree86/common/xf86Option.c
@@ -164,6 +164,10 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
else
pInfo->options = tmp;
}
+
+ if (pInfo->conf_idev && pInfo->conf_idev->attrs) {
+ pInfo->attrs = pInfo->conf_idev->attrs;
+ }
}
/* Created for new XInput stuff -- essentially extensions to the parser */
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index 55cd49c1f..21921b2c3 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -622,7 +622,6 @@ MergeInputClasses(IDevPtr idev, InputAttributes *attrs)
mergedopts = xf86ReplaceStrOption(mergedopts, "driver", idev->driver);
}
idev->commonOptions = xf86optionListMerge(idev->commonOptions, mergedopts);
-
return Success;
}
@@ -822,6 +821,8 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
rval = MergeInputClasses(idev, attrs);
if (rval != Success)
goto unwind;
+
+ idev->attrs = DuplicateInputAttributes(attrs);
}
if (!idev->driver || !idev->identifier) {
@@ -853,7 +854,7 @@ unwind:
}
void
-DeleteInputDeviceRequest(DeviceIntPtr pDev)
+DeleteInputDeviceRequest(DeviceIntPtr pDev, int flags)
{
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
InputDriverPtr drv = NULL;
@@ -873,9 +874,9 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
if (!isMaster && pInfo != NULL)
{
if(drv->UnInit)
- drv->UnInit(drv, pInfo, 0);
+ drv->UnInit(drv, pInfo, flags);
else
- xf86DeleteInput(pInfo, 0);
+ xf86DeleteInput(pInfo, flags);
/* devices added through HAL aren't in the config layout */
it = xf86ConfigLayout.inputs;
@@ -1266,7 +1267,7 @@ xf86DisableDevice(DeviceIntPtr dev, Bool panic)
} else
{
SendDevicePresenceEvent(dev->id, DeviceUnrecoverable);
- DeleteInputDeviceRequest(dev);
+ DeleteInputDeviceRequest(dev, 0);
}
}
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h
index aa9e9d507..d78c22333 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.h
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.h
@@ -1,219 +1,220 @@
-/*
- * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
- *
- * 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 Frederic Lepied not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Frederic Lepied makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL FREDERIC LEPIED 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) 2000-2002 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 _xf86Xinput_h
-#define _xf86Xinput_h
-
-#include "xf86str.h"
-#include "inputstr.h"
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-
-/* Input device flags */
-#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
-#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
-/* the device sends Xinput and core pointer events */
-#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
-/* if the device is the core pointer or is sending core events, and
- * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
- * (mouse drag action) are sent. This is mainly to allow a touch screen to be
- * used with netscape and other browsers which do strange things if the mouse
- * moves between button down and button up. With a touch screen, this motion
- * is common due to the user's finger moving slightly.
- */
-#define XI86_SEND_DRAG_EVENTS 0x08
-#define XI86_CORE_POINTER 0x10 /* device is the core pointer */
-#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
-#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
-#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
-
-#define XI_PRIVATE(dev) \
- (((LocalDevicePtr)((dev)->public.devicePrivate))->private)
-
-/* Valuator verification macro */
-#define XI_VERIFY_VALUATORS(num_valuators) \
- if (num_valuators > MAX_VALUATORS) { \
- xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
- " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
- return; \
- }
-
-/* Stupid API backwards-compatibility. */
-#define TS_Raw 60
-#define TS_Scaled 61
-
-/* This holds the input driver entry and module information. */
-typedef struct _InputDriverRec {
- int driverVersion;
- char * driverName;
- void (*Identify)(int flags);
- struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
- IDevPtr dev, int flags);
- void (*UnInit)(struct _InputDriverRec *drv,
- struct _LocalDeviceRec *pInfo,
- int flags);
- pointer module;
- int refCount;
-} InputDriverRec, *InputDriverPtr;
-
-/* This is to input devices what the ScrnInfoRec is to screens. */
-
-typedef struct _LocalDeviceRec {
- struct _LocalDeviceRec *next;
- char * name;
- int flags;
-
- Bool (*device_control)(DeviceIntPtr device, int what);
- void (*read_input)(struct _LocalDeviceRec *local);
- int (*control_proc)(struct _LocalDeviceRec *local,
- xDeviceCtl *control);
- void (*close_proc)(struct _LocalDeviceRec *local);
- int (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
- int mode);
- Bool (*conversion_proc)(struct _LocalDeviceRec *local,
- int first, int num, int v0,
- int v1, int v2, int v3, int v4,
- int v5, int *x, int *y);
- Bool (*reverse_conversion_proc)(
- struct _LocalDeviceRec *local,
- int x, int y, int *valuators);
- int (*set_device_valuators)
- (struct _LocalDeviceRec *local,
- int *valuators, int first_valuator,
- int num_valuators);
-
- int fd;
- Atom atom;
- DeviceIntPtr dev;
- pointer private;
- int private_flags;
- unsigned int first;
- unsigned int last;
- int old_x;
- int old_y;
- char * type_name;
- IntegerFeedbackPtr always_core_feedback;
- IDevPtr conf_idev;
- InputDriverPtr drv;
- pointer module;
- pointer options;
- unsigned int history_size;
-} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
-
-typedef struct _DeviceAssocRec
-{
- char * config_section_name;
- LocalDevicePtr (*device_allocate)(void);
-} DeviceAssocRec, *DeviceAssocPtr;
-
-/* xf86Globals.c */
-extern _X_EXPORT InputInfoPtr xf86InputDevs;
-
-/* xf86Xinput.c */
-extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, ...);
-extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, int *valuators);
-extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
- int first_valuator, int num_valuators, ...);
-extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
- int num_valuators, int *valuators);
-extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
- int is_down, int first_valuator, int num_valuators,
- ...);
-extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
- int is_down, int first_valuator, int num_valuators,
- int *valuators);
-extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
- int is_absolute, int first_valuator, int num_valuators,
- ...);
-extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
- int is_absolute, int first_valuator, int num_valuators,
- int *valuators);
-extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
- int is_down);
-extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
-extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void);
-extern _X_EXPORT int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
-extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
-extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
-extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
- int maxval, int resolution, int min_res,
- int max_res);
-extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
-extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo);
-extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
-extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
-extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
-/* not exported */
-int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto);
-
-/* xf86Helper.c */
-extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
-extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex);
-extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
-extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name);
-extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name);
-extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags);
-extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local);
-
-/* xf86Option.c */
-extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts);
-
-
-/* Legacy hatred */
-#define SendCoreEvents 59
-#define DontSendCoreEvents 60
-
-#endif /* _xf86Xinput_h */
+/*
+ * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
+ *
+ * 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 Frederic Lepied not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Frederic Lepied makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL FREDERIC LEPIED 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) 2000-2002 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 _xf86Xinput_h
+#define _xf86Xinput_h
+
+#include "xf86str.h"
+#include "inputstr.h"
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+
+/* Input device flags */
+#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */
+#define XI86_CONFIGURED 0x02 /* the device has been configured */
+#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
+/* the device sends Xinput and core pointer events */
+#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
+/* if the device is the core pointer or is sending core events, and
+ * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
+ * (mouse drag action) are sent. This is mainly to allow a touch screen to be
+ * used with netscape and other browsers which do strange things if the mouse
+ * moves between button down and button up. With a touch screen, this motion
+ * is common due to the user's finger moving slightly.
+ */
+#define XI86_SEND_DRAG_EVENTS 0x08
+#define XI86_CORE_POINTER 0x10 /* device is the core pointer */
+#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
+#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
+#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
+
+#define XI_PRIVATE(dev) \
+ (((LocalDevicePtr)((dev)->public.devicePrivate))->private)
+
+/* Valuator verification macro */
+#define XI_VERIFY_VALUATORS(num_valuators) \
+ if (num_valuators > MAX_VALUATORS) { \
+ xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
+ " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
+ return; \
+ }
+
+/* Stupid API backwards-compatibility. */
+#define TS_Raw 60
+#define TS_Scaled 61
+
+/* This holds the input driver entry and module information. */
+typedef struct _InputDriverRec {
+ int driverVersion;
+ char * driverName;
+ void (*Identify)(int flags);
+ struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
+ IDevPtr dev, int flags);
+ void (*UnInit)(struct _InputDriverRec *drv,
+ struct _LocalDeviceRec *pInfo,
+ int flags);
+ pointer module;
+ int refCount;
+} InputDriverRec, *InputDriverPtr;
+
+/* This is to input devices what the ScrnInfoRec is to screens. */
+
+typedef struct _LocalDeviceRec {
+ struct _LocalDeviceRec *next;
+ char * name;
+ int flags;
+
+ Bool (*device_control)(DeviceIntPtr device, int what);
+ void (*read_input)(struct _LocalDeviceRec *local);
+ int (*control_proc)(struct _LocalDeviceRec *local,
+ xDeviceCtl *control);
+ void (*close_proc)(struct _LocalDeviceRec *local);
+ int (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
+ int mode);
+ Bool (*conversion_proc)(struct _LocalDeviceRec *local,
+ int first, int num, int v0,
+ int v1, int v2, int v3, int v4,
+ int v5, int *x, int *y);
+ Bool (*reverse_conversion_proc)(
+ struct _LocalDeviceRec *local,
+ int x, int y, int *valuators);
+ int (*set_device_valuators)
+ (struct _LocalDeviceRec *local,
+ int *valuators, int first_valuator,
+ int num_valuators);
+
+ int fd;
+ Atom atom;
+ DeviceIntPtr dev;
+ pointer private;
+ int private_flags;
+ unsigned int first;
+ unsigned int last;
+ int old_x;
+ int old_y;
+ char * type_name;
+ IntegerFeedbackPtr always_core_feedback;
+ IDevPtr conf_idev;
+ InputDriverPtr drv;
+ pointer module;
+ pointer options;
+ unsigned int history_size;
+ InputAttributes *attrs;
+} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
+
+typedef struct _DeviceAssocRec
+{
+ char * config_section_name;
+ LocalDevicePtr (*device_allocate)(void);
+} DeviceAssocRec, *DeviceAssocPtr;
+
+/* xf86Globals.c */
+extern _X_EXPORT InputInfoPtr xf86InputDevs;
+
+/* xf86Xinput.c */
+extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
+ int first_valuator, int num_valuators, ...);
+extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
+ int first_valuator, int num_valuators, int *valuators);
+extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
+ int first_valuator, int num_valuators, ...);
+extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
+ int num_valuators, int *valuators);
+extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
+ int is_down, int first_valuator, int num_valuators,
+ ...);
+extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
+ int is_down, int first_valuator, int num_valuators,
+ int *valuators);
+extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
+ int is_absolute, int first_valuator, int num_valuators,
+ ...);
+extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
+ int is_absolute, int first_valuator, int num_valuators,
+ int *valuators);
+extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
+ int is_down);
+extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
+extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void);
+extern _X_EXPORT int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
+extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
+extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
+extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
+ int maxval, int resolution, int min_res,
+ int max_res);
+extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
+extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
+extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
+/* not exported */
+int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto);
+
+/* xf86Helper.c */
+extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
+extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex);
+extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
+extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name);
+extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name);
+extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags);
+extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local);
+
+/* xf86Option.c */
+extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
+ pointer extraOpts);
+
+
+/* Legacy hatred */
+#define SendCoreEvents 59
+#define DontSendCoreEvents 60
+
+#endif /* _xf86Xinput_h */
diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h
index c4fbe0403..58438db76 100644
--- a/xorg-server/hw/xfree86/common/xf86str.h
+++ b/xorg-server/hw/xfree86/common/xf86str.h
@@ -406,6 +406,7 @@ typedef struct {
char * driver;
pointer commonOptions;
pointer extraOptions;
+ InputAttributes *attrs;
} IDevRec, *IDevPtr;
typedef struct {
diff --git a/xorg-server/hw/xnest/Cursor.c b/xorg-server/hw/xnest/Cursor.c
index 290074d4e..f35517abb 100644
--- a/xorg-server/hw/xnest/Cursor.c
+++ b/xorg-server/hw/xnest/Cursor.c
@@ -167,8 +167,7 @@ xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
pScreenPriv = (xnestCursorFuncPtr)
dixLookupPrivate(&pScreen->devPrivates, xnestCursorScreenKey);
- pScreenPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
- return TRUE;
+ return pScreenPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
}
void
diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c
index 90e440e54..cba2853a3 100644
--- a/xorg-server/hw/xquartz/darwinXinput.c
+++ b/xorg-server/hw/xquartz/darwinXinput.c
@@ -1,257 +1,257 @@
-/*
- * X server support of the XINPUT extension for xquartz
- *
- * This is currently a copy of Xi/stubs.c, but eventually this
- * should include more complete XINPUT support.
- */
-
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-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.
-
-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
-OPEN GROUP 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 Open Group 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 Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-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 Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD 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.
-
-********************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "inputstr.h"
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "darwin.h"
-
-/***********************************************************************
- *
- * Caller: ProcXCloseDevice
- *
- * Take care of implementation-dependent details of closing a device.
- * Some implementations may actually close the device, others may just
- * remove this clients interest in that device.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- *
- */
-
-void
-CloseInputDevice(DeviceIntPtr d, ClientPtr client)
-{
- DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client);
-}
-
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices(void)
-{
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
- DEBUG_LOG("AddOtherInputDevices\n");
-}
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
-{
- DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status);
-}
-
-/****************************************************************************
- *
- * Caller: ProcXSetDeviceMode
- *
- * Change the mode of an extension device.
- * This function is used to change the mode of a device from reporting
- * relative motion to reporting absolute positional information, and
- * vice versa.
- * The default implementation below is that no such devices are supported.
- *
- */
-
-int
-SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
-{
- DEBUG_LOG("SetDeviceMode(%p, %p, %d)\n", client, dev, mode);
- return BadMatch;
-}
-
-/****************************************************************************
- *
- * Caller: ProcXSetDeviceValuators
- *
- * Set the value of valuators on an extension input device.
- * This function is used to set the initial value of valuators on
- * those input devices that are capable of reporting either relative
- * motion or an absolute position, and allow an initial position to be set.
- * The default implementation below is that no such devices are supported.
- *
- */
-
-int
-SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
- int *valuators, int first_valuator, int num_valuators)
-{
- DEBUG_LOG("SetDeviceValuators(%p, %p, %p, %d, %d)\n", client,
- dev, valuators, first_valuator, num_valuators);
- return BadMatch;
-}
-
-/****************************************************************************
- *
- * Caller: ProcXChangeDeviceControl
- *
- * Change the specified device controls on an extension input device.
- *
- */
-
-int
-ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
- xDeviceCtl * control)
-{
-
- DEBUG_LOG("ChangeDeviceControl(%p, %p, %p)\n", client, dev, control);
- switch (control->control) {
- case DEVICE_RESOLUTION:
- return (BadMatch);
- case DEVICE_ABS_CALIB:
- case DEVICE_ABS_AREA:
- return (BadMatch);
- case DEVICE_CORE:
- return (BadMatch);
- default:
- return (BadMatch);
- }
-}
-
-
-/****************************************************************************
- *
- * Caller: configAddDevice (and others)
- *
- * Add a new device with the specified options.
- *
- */
-int
-NewInputDeviceRequest(InputOption *options, InputAttributes *attrs,
- DeviceIntPtr *pdev)
-{
- DEBUG_LOG("NewInputDeviceRequest(%p, %p)\n", options, pdev);
- return BadValue;
-}
-
-/****************************************************************************
- *
- * Caller: configRemoveDevice (and others)
- *
- * Remove the specified device previously added.
- *
- */
-void
-DeleteInputDeviceRequest(DeviceIntPtr dev)
-{
- DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev);
-}
-
-void
-CloseInput (void)
-{
-}
-
+/*
+ * X server support of the XINPUT extension for xquartz
+ *
+ * This is currently a copy of Xi/stubs.c, but eventually this
+ * should include more complete XINPUT support.
+ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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 Open Group 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 Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD 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.
+
+********************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "inputstr.h"
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "darwin.h"
+
+/***********************************************************************
+ *
+ * Caller: ProcXCloseDevice
+ *
+ * Take care of implementation-dependent details of closing a device.
+ * Some implementations may actually close the device, others may just
+ * remove this clients interest in that device.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are initialized during X server initialization and kept open).
+ *
+ */
+
+void
+CloseInputDevice(DeviceIntPtr d, ClientPtr client)
+{
+ DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client);
+}
+
+/***********************************************************************
+ *
+ * Caller: ProcXListInputDevices
+ *
+ * This is the implementation-dependent routine to initialize an input
+ * device to the point that information about it can be listed.
+ * Some implementations open all input devices when the server is first
+ * initialized, and never close them. Other implementations open only
+ * the X pointer and keyboard devices during server initialization,
+ * and only open other input devices when some client makes an
+ * XOpenDevice request. If some other process has the device open, the
+ * server may not be able to get information about the device to list it.
+ *
+ * This procedure should be used by implementations that do not initialize
+ * all input devices at server startup. It should do device-dependent
+ * initialization for any devices not previously initialized, and call
+ * AddInputDevice for each of those devices so that a DeviceIntRec will be
+ * created for them.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are initialized during X server initialization and kept open).
+ * The commented-out sample code shows what you might do if you don't want
+ * the default.
+ *
+ */
+
+void
+AddOtherInputDevices(void)
+{
+ /**********************************************************************
+ for each uninitialized device, do something like:
+
+ DeviceIntPtr dev;
+ DeviceProc deviceProc;
+ pointer private;
+
+ dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
+ dev->public.devicePrivate = private;
+ RegisterOtherDevice(dev);
+ dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
+ ************************************************************************/
+ DEBUG_LOG("AddOtherInputDevices\n");
+}
+
+/***********************************************************************
+ *
+ * Caller: ProcXOpenDevice
+ *
+ * This is the implementation-dependent routine to open an input device.
+ * Some implementations open all input devices when the server is first
+ * initialized, and never close them. Other implementations open only
+ * the X pointer and keyboard devices during server initialization,
+ * and only open other input devices when some client makes an
+ * XOpenDevice request. This entry point is for the latter type of
+ * implementation.
+ *
+ * If the physical device is not already open, do it here. In this case,
+ * you need to keep track of the fact that one or more clients has the
+ * device open, and physically close it when the last client that has
+ * it open does an XCloseDevice.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are opened during X server initialization and kept open).
+ *
+ */
+
+void
+OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
+{
+ DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status);
+}
+
+/****************************************************************************
+ *
+ * Caller: ProcXSetDeviceMode
+ *
+ * Change the mode of an extension device.
+ * This function is used to change the mode of a device from reporting
+ * relative motion to reporting absolute positional information, and
+ * vice versa.
+ * The default implementation below is that no such devices are supported.
+ *
+ */
+
+int
+SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
+{
+ DEBUG_LOG("SetDeviceMode(%p, %p, %d)\n", client, dev, mode);
+ return BadMatch;
+}
+
+/****************************************************************************
+ *
+ * Caller: ProcXSetDeviceValuators
+ *
+ * Set the value of valuators on an extension input device.
+ * This function is used to set the initial value of valuators on
+ * those input devices that are capable of reporting either relative
+ * motion or an absolute position, and allow an initial position to be set.
+ * The default implementation below is that no such devices are supported.
+ *
+ */
+
+int
+SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
+ int *valuators, int first_valuator, int num_valuators)
+{
+ DEBUG_LOG("SetDeviceValuators(%p, %p, %p, %d, %d)\n", client,
+ dev, valuators, first_valuator, num_valuators);
+ return BadMatch;
+}
+
+/****************************************************************************
+ *
+ * Caller: ProcXChangeDeviceControl
+ *
+ * Change the specified device controls on an extension input device.
+ *
+ */
+
+int
+ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
+ xDeviceCtl * control)
+{
+
+ DEBUG_LOG("ChangeDeviceControl(%p, %p, %p)\n", client, dev, control);
+ switch (control->control) {
+ case DEVICE_RESOLUTION:
+ return (BadMatch);
+ case DEVICE_ABS_CALIB:
+ case DEVICE_ABS_AREA:
+ return (BadMatch);
+ case DEVICE_CORE:
+ return (BadMatch);
+ default:
+ return (BadMatch);
+ }
+}
+
+
+/****************************************************************************
+ *
+ * Caller: configAddDevice (and others)
+ *
+ * Add a new device with the specified options.
+ *
+ */
+int
+NewInputDeviceRequest(InputOption *options, InputAttributes *attrs,
+ DeviceIntPtr *pdev)
+{
+ DEBUG_LOG("NewInputDeviceRequest(%p, %p)\n", options, pdev);
+ return BadValue;
+}
+
+/****************************************************************************
+ *
+ * Caller: configRemoveDevice (and others)
+ *
+ * Remove the specified device previously added.
+ *
+ */
+void
+DeleteInputDeviceRequest(DeviceIntPtr dev, int flags)
+{
+ DEBUG_LOG("DeleteInputDeviceRequest(%p)\n", dev);
+}
+
+void
+CloseInput (void)
+{
+}
+