[PATCH 18/19] input: remove OpenInputDevice and CloseInputDevice DDX hooks.

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 29 23:21:34 PDT 2010


In theory, these hooks were to be used for DDX-specific device enablement.
None of the DDXs however did anything here. Now we call DEVICE_INIT on all
devices when they are added, so the xfree86 DDX as the only one with real
code didn't do anything here.

kdrive checked for device validity but that's already handled in
ProcXOpenDevice.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xi/closedev.c                  |    1 -
 Xi/opendev.c                   |    1 -
 Xi/stubs.c                     |   46 ----------------------------------------
 hw/dmx/input/dmxxinput.c       |   12 ----------
 hw/kdrive/src/kinput.c         |   17 --------------
 hw/xfree86/common/xf86Xinput.c |   41 -----------------------------------
 hw/xquartz/darwinXinput.c      |   28 ------------------------
 include/XIstubs.h              |   11 ---------
 8 files changed, 0 insertions(+), 157 deletions(-)

diff --git a/Xi/closedev.c b/Xi/closedev.c
index e319c73..1064be6 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -162,6 +162,5 @@ ProcXCloseDevice(ClientPtr client)
 	DeleteEventsFromChildren(d, p1, client);
     }
 
-    CloseInputDevice(d, client);
     return Success;
 }
diff --git a/Xi/opendev.c b/Xi/opendev.c
index e4c02d3..13841dc 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -115,7 +115,6 @@ ProcXOpenDevice(ClientPtr client)
     if (IsMaster(dev))
             return BadDevice;
 
-    OpenInputDevice(dev, client, &status);
     if (status != Success)
 	return status;
 
diff --git a/Xi/stubs.c b/Xi/stubs.c
index de80042..4c9795a 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -68,24 +68,6 @@ SOFTWARE.
 
 /***********************************************************************
  *
- * 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)
-{
-}
-
-/***********************************************************************
- *
  * Caller:	ProcXListInputDevices
  *
  * This is the implementation-dependent routine to initialize an input
@@ -127,34 +109,6 @@ AddOtherInputDevices(void)
 
 }
 
-/***********************************************************************
- *
- * 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)
-{
-    *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess);
-}
-
 /****************************************************************************
  *
  * Caller:	ProcXSetDeviceMode
diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c
index 8b58eeb..a5c28a9 100644
--- a/hw/dmx/input/dmxxinput.c
+++ b/hw/dmx/input/dmxxinput.c
@@ -51,23 +51,11 @@
 #include "dmxinputinit.h"
 #include "exevents.h"
 
-/** Close the input device.  This is not required by the XINPUT model
- * that DMX uses. */
-void CloseInputDevice (DeviceIntPtr d, ClientPtr client)
-{
-}
-
 /** This is not required by the XINPUT model that DMX uses. */
 void AddOtherInputDevices(void)
 {
 }
 
-/** Open an input device.  This is not required by the XINPUT model that
- * DMX uses. */
-void OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status)
-{
-}
-
 /** Set device mode to \a mode.  This is not implemented. */
 int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
 {
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index a4691df..2ab6dc2 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2176,23 +2176,6 @@ ProcessInputEvents (void)
     KdCheckLock ();
 }
 
-/* FIXME use XSECURITY to work out whether the client should be allowed to
- * open and close. */
-void
-OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status)
-{
-    if (!pDev)
-        *status = BadDevice;
-    else
-        *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr pDev, ClientPtr client)
-{
-    return;
-}
-
 /* We initialise all input devices at startup. */
 void
 AddOtherInputDevices(void)
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index ea82638..14da6a5 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -331,47 +331,6 @@ xf86ActivateDevice(InputInfoPtr pInfo)
     return dev;
 }
 
-
-/***********************************************************************
- *
- * 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)
-{
-    if (!dev->inited)
-        ActivateDevice(dev, TRUE);
-
-    *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr dev,
-                 ClientPtr client)
-{
-}
-
 /****************************************************************************
  *
  * Caller:	ProcXSetDeviceMode
diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c
index 966aaf3..64d9b23 100644
--- a/hw/xquartz/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -125,34 +125,6 @@ AddOtherInputDevices(void)
   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
diff --git a/include/XIstubs.h b/include/XIstubs.h
index ba2f861..0bb773e 100644
--- a/include/XIstubs.h
+++ b/include/XIstubs.h
@@ -27,19 +27,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define XI_STUBS_H 1
 
 extern _X_EXPORT void
-CloseInputDevice (
-	DeviceIntPtr           /* d */,
-	ClientPtr              /* client */);
-
-extern _X_EXPORT void
 AddOtherInputDevices (void);
 
-extern _X_EXPORT void
-OpenInputDevice (
-	DeviceIntPtr           /* dev */,
-	ClientPtr              /* client */,
-	int *                  /* status */);
-
 extern _X_EXPORT int
 SetDeviceMode (
 	ClientPtr              /* client */,
-- 
1.7.2



More information about the xorg-devel mailing list