xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Sep 1 18:04:46 UTC 2024


 Xext/xtest.c                   |    1 
 Xi/chgdctl.c                   |    1 
 Xi/exevents.c                  |    1 
 Xi/listdev.c                   |    6 
 Xi/queryst.c                   |    1 
 Xi/setbmap.c                   |    6 
 Xi/setdval.c                   |    6 
 Xi/setmmap.c                   |    6 
 Xi/setmode.c                   |    6 
 Xi/xiallowev.c                 |    1 
 Xi/xibarriers.c                |    1 
 Xi/xichangehierarchy.c         |    1 
 Xi/xiproperty.c                |    1 
 Xi/xiquerydevice.c             |    1 
 Xi/xiquerypointer.c            |    1 
 dix/devices.c                  |    1 
 dix/dispatch.c                 |    2 
 dix/enterleave.c               |    1 
 dix/events.c                   |    1 
 dix/gestures.c                 |    1 
 dix/getevents.c                |   16 +
 dix/input_priv.h               |  354 +++++++++++++++++++++++++++++++++++++++++
 dix/inpututils.c               |    2 
 dix/main.c                     |    9 -
 dix/touch.c                    |    1 
 dix/window.c                   |    2 
 hw/kdrive/ephyr/hostx.c        |    8 
 hw/kdrive/src/kinput.c         |    6 
 hw/xfree86/common/xf86Cursor.c |    6 
 hw/xfree86/common/xf86Events.c |    7 
 hw/xfree86/common/xf86Helper.c |    1 
 hw/xfree86/common/xf86Init.c   |    2 
 hw/xfree86/common/xf86RandR.c  |    3 
 hw/xfree86/common/xf86Xinput.c |    1 
 hw/xfree86/modes/xf86RandR12.c |    4 
 hw/xwayland/xwayland-input.c   |    1 
 hw/xwayland/xwayland-output.c  |    1 
 hw/xwayland/xwayland-screen.c  |    1 
 hw/xwayland/xwayland-xtest.c   |    1 
 hw/xwin/winerror.c             |    2 
 include/input.h                |  257 -----------------------------
 mi/mipointer.c                 |    1 
 mi/miwindow.c                  |    3 
 miext/sync/misyncfd.c          |    2 
 os/inputthread.c               |    1 
 os/log.c                       |    2 
 os/utils.c                     |    1 
 test/input.c                   |    1 
 test/misc.c                    |    4 
 test/touch.c                   |    4 
 test/xtest.c                   |    3 
 xkb/xkbAccessX.c               |    1 
 xkb/xkbActions.c               |    1 
 xkb/xkbPrKeyEv.c               |    1 
 54 files changed, 462 insertions(+), 294 deletions(-)

New commits:
commit 2cec3cfbf18ebdd0c35cd23d1258f19c3f534db8
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Mon Feb 12 17:43:56 2024 +0100

    include: move private definitions out of input.h
    
    It's not good having the public server api headers clobbered with private
    definitions, so cleaning them up.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1354>

diff --git a/Xext/xtest.c b/Xext/xtest.c
index b451e41cd..ddd02f610 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -37,6 +37,7 @@
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 
+#include "dix/input_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
 #include "os/osdep.h"
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index a6325a1c6..4dd4799ad 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -58,6 +58,7 @@ SOFTWARE.
 #include <X11/extensions/XIproto.h>     /* control constants */
 
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
 #include "XIstubs.h"
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 71384254d..30b1a72dd 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -93,6 +93,7 @@ SOFTWARE.
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"
 #include "windowstr.h"
diff --git a/Xi/listdev.c b/Xi/listdev.c
index c8076a62d..acd73af28 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -56,16 +56,18 @@ SOFTWARE.
 
 #include <X11/X.h>              /* for inputstr.h    */
 #include <X11/Xproto.h>         /* Request macro     */
-#include "inputstr.h"           /* DeviceIntPtr      */
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "inputstr.h"           /* DeviceIntPtr      */
 #include "XIstubs.h"
 #include "extnsionst.h"
 #include "exevents.h"
 #include "xace.h"
 #include "xkbsrv.h"
 #include "xkbstr.h"
-
 #include "listdev.h"
 
 /***********************************************************************
diff --git a/Xi/queryst.c b/Xi/queryst.c
index 34bfa9031..d0aad33de 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -40,6 +40,7 @@ from The Open Group.
 #include <X11/extensions/XIproto.h>
 
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
 #include "windowstr.h"          /* window structure  */
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index f94db861d..cad881b7a 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -54,12 +54,14 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
-#include "inputstr.h"           /* DeviceIntPtr      */
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "inputstr.h"           /* DeviceIntPtr      */
 #include "exevents.h"
 #include "exglobals.h"
-
 #include "setbmap.h"
 
 /***********************************************************************
diff --git a/Xi/setdval.c b/Xi/setdval.c
index e57cb259d..26dedfbf6 100644
--- a/Xi/setdval.c
+++ b/Xi/setdval.c
@@ -54,12 +54,14 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
-#include "inputstr.h"           /* DeviceIntPtr      */
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "inputstr.h"           /* DeviceIntPtr      */
 #include "XIstubs.h"
 #include "exglobals.h"
-
 #include "setdval.h"
 
 /***********************************************************************
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index d60096a5a..5adc7e9d5 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -54,13 +54,15 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
-#include "inputstr.h"           /* DeviceIntPtr      */
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XI2.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "inputstr.h"           /* DeviceIntPtr      */
 #include "exevents.h"
 #include "exglobals.h"
-
 #include "setmmap.h"
 
 /***********************************************************************
diff --git a/Xi/setmode.c b/Xi/setmode.c
index e7e12d4e0..f67e89e1a 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -54,12 +54,14 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
-#include "inputstr.h"           /* DeviceIntPtr      */
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "inputstr.h"           /* DeviceIntPtr      */
 #include "XIstubs.h"
 #include "exglobals.h"
-
 #include "setmode.h"
 
 /***********************************************************************
diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
index 03ced79bb..23ad4c7ce 100644
--- a/Xi/xiallowev.c
+++ b/Xi/xiallowev.c
@@ -38,6 +38,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
 #include "windowstr.h"          /* window structure  */
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index da6964453..5cccebdf2 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -46,6 +46,7 @@
 #endif
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 
 #include "xibarriers.h"
 #include "scrnintstr.h"
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index eea917ff6..99cc25045 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -42,6 +42,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
 #include "windowstr.h"          /* window structure  */
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index aaafc629b..5ac5d1c1d 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -35,6 +35,7 @@
 #include <X11/extensions/XI2proto.h>
 
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "dix.h"
 #include "inputstr.h"
diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index cd9bb39d5..e286064c2 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -37,6 +37,7 @@
 #include <X11/extensions/XI2proto.h>
 
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"
 #include "xkbstr.h"
diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c
index 2ac3e73a0..594804662 100644
--- a/Xi/xiquerypointer.c
+++ b/Xi/xiquerypointer.c
@@ -41,6 +41,7 @@
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
 #include "windowstr.h"          /* window structure  */
diff --git a/dix/devices.c b/dix/devices.c
index d63cebbb3..48f701be3 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -59,6 +59,7 @@ SOFTWARE.
 
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 #include "dix/ptrveloc_priv.h"
 #include "xkb/xkbsrv_priv.h"
 
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 72cd08750..f588579bc 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -106,6 +106,7 @@ Equipment Corporation.
 #include <X11/fonts/libxfont2.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "dix/gc_priv.h"
 #include "dix/registry_priv.h"
 #include "dix/screenint_priv.h"
@@ -121,7 +122,6 @@ Equipment Corporation.
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
-#include "input.h"
 #include "servermd.h"
 #include "extnsionst.h"
 #include "dixfont.h"
diff --git a/dix/enterleave.c b/dix/enterleave.c
index 57a3d9967..cb6209c1d 100644
--- a/dix/enterleave.c
+++ b/dix/enterleave.c
@@ -35,6 +35,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"
 #include "windowstr.h"
diff --git a/dix/events.c b/dix/events.c
index 46f7f6212..3a9c47cc1 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -115,6 +115,7 @@ Equipment Corporation.
 #include <X11/extensions/XI2proto.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "dix/eventconvert.h"
 #include "dix/exevents_priv.h"
 #include "xkb/xkbsrv_priv.h"
diff --git a/dix/gestures.c b/dix/gestures.c
index 2c47abb09..fb4afb629 100644
--- a/dix/gestures.c
+++ b/dix/gestures.c
@@ -29,6 +29,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"
 #include "scrnintstr.h"
diff --git a/dix/getevents.c b/dix/getevents.c
index c39ef3371..19170f4a5 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -31,11 +31,18 @@
 #include <dix-config.h>
 #endif
 
+#include <math.h>
+#include <limits.h>
+#include <pixman.h>
 #include <X11/X.h>
 #include <X11/keysym.h>
 #include <X11/Xproto.h>
-#include <math.h>
-#include <limits.h>
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XI2.h>
+#include <X11/extensions/XIproto.h>
+#include <X11/extensions/XKBproto.h>
+
+#include "dix/input_priv.h"
 
 #include "misc.h"
 #include "resource.h"
@@ -52,7 +59,6 @@
 #include "mi.h"
 #include "windowstr.h"
 
-#include <X11/extensions/XKBproto.h>
 #include "xkbsrv.h"
 
 #ifdef PANORAMIX
@@ -60,10 +66,6 @@
 #include "panoramiXsrv.h"
 #endif
 
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XI2.h>
-#include <X11/extensions/XIproto.h>
-#include <pixman.h>
 #include "exglobals.h"
 #include "exevents.h"
 #include "extnsionst.h"
diff --git a/dix/input_priv.h b/dix/input_priv.h
new file mode 100644
index 000000000..5a93a68d1
--- /dev/null
+++ b/dix/input_priv.h
@@ -0,0 +1,354 @@
+/* SPDX-License-Identifier: MIT OR X11
+ *
+ + Copyright © 1987, 1998  The Open Group
+ * Copyright © 2024 Enrico Weigelt, metux IT consult <info at metux.net>
+ */
+/************************************************************
+
+Copyright 1987, 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 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+********************************************************/
+#ifndef _XSERVER_INPUT_PRIV_H
+#define _XSERVER_INPUT_PRIV_H
+
+#include "input.h"
+
+typedef struct _InputOption InputOption;
+typedef struct _XI2Mask XI2Mask;
+
+void InitCoreDevices(void);
+void InitXTestDevices(void);
+
+void DisableAllDevices(void);
+int InitAndStartDevices(void);
+
+void CloseDownDevices(void);
+void AbortDevices(void);
+
+void UndisplayDevices(void);
+
+ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src, int numAxes);
+void FreeDeviceClass(int type, void **class);
+
+int ApplyPointerMapping(DeviceIntPtr pDev,
+                        CARD8 *map,
+                        int len,
+                        ClientPtr client);
+
+Bool BadDeviceMap(BYTE *buff,
+                  int length,
+                  unsigned low,
+                  unsigned high,
+                  XID *errval);
+
+void NoteLedState(DeviceIntPtr keybd, int led, Bool on);
+
+void MaybeStopHint(DeviceIntPtr device, ClientPtr client );
+
+void ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse);
+
+void ProcessKeyboardEvent(InternalEvent *ev, DeviceIntPtr keybd);
+
+void CreateClassesChangedEvent(InternalEvent *event,
+                               DeviceIntPtr master,
+                               DeviceIntPtr slave,
+                               int flags);
+
+InternalEvent *UpdateFromMaster(InternalEvent *events,
+                                DeviceIntPtr pDev,
+                                int type,
+                                int *num_events);
+
+void PostSyntheticMotion(DeviceIntPtr pDev,
+                         int x,
+                         int y,
+                         int screen,
+                         unsigned long time);
+
+void ReleaseButtonsAndKeys(DeviceIntPtr dev);
+
+int AttachDevice(ClientPtr client, DeviceIntPtr slave, DeviceIntPtr master);
+
+void DeepCopyDeviceClasses(DeviceIntPtr from,
+                           DeviceIntPtr to,
+                           DeviceChangedEvent *dce);
+
+int change_modmap(ClientPtr client,
+                  DeviceIntPtr dev,
+                  KeyCode *map,
+                  int max_keys_per_mod);
+
+int AllocXTestDevice(ClientPtr client,
+                     const char *name,
+                     DeviceIntPtr *ptr,
+                     DeviceIntPtr *keybd,
+                     DeviceIntPtr master_ptr,
+                     DeviceIntPtr master_keybd);
+BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
+DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
+
+void SendDevicePresenceEvent(int deviceid, int type);
+void DeliverDeviceClassesChangedEvent(int sourceid, Time time);
+
+/* touch support */
+int GetTouchEvents(InternalEvent *events,
+                   DeviceIntPtr pDev,
+                   uint32_t ddx_touchid,
+                   uint16_t type,
+                   uint32_t flags,
+                   const ValuatorMask *mask);
+void QueueTouchEvents(DeviceIntPtr device,
+                      int type,
+                      uint32_t ddx_touchid,
+                      int flags, const ValuatorMask *mask);
+int GetTouchOwnershipEvents(InternalEvent *events,
+                            DeviceIntPtr pDev,
+                            TouchPointInfoPtr ti,
+                            uint8_t mode,
+                            XID resource,
+                            uint32_t flags);
+void GetDixTouchEnd(InternalEvent *ievent,
+                    DeviceIntPtr dev,
+                    TouchPointInfoPtr ti,
+                    uint32_t flags);
+void TouchInitDDXTouchPoint(DeviceIntPtr dev, DDXTouchPointInfoPtr ddxtouch);
+DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id);
+void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti);
+DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev,
+                                      uint32_t ddx_id,
+                                      Bool create);
+Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v, int index);
+void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
+TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev,
+                                  int sourceid,
+                                  uint32_t touchid,
+                                  Bool emulate_pointer);
+TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev, uint32_t client_id);
+void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti);
+Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
+void TouchEventHistoryFree(TouchPointInfoPtr ti);
+void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
+void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
+Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
+void TouchAddListener(TouchPointInfoPtr ti,
+                      XID resource,
+                      int resource_type,
+                      enum InputLevel level,
+                      enum TouchListenerType type,
+                      enum TouchListenerState state,
+                      WindowPtr window,
+                      GrabPtr grab);
+Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
+void TouchSetupListeners(DeviceIntPtr dev,
+                         TouchPointInfoPtr ti,
+                         InternalEvent *ev);
+Bool TouchBuildSprite(DeviceIntPtr sourcedev,
+                      TouchPointInfoPtr ti,
+                      InternalEvent *ev);
+Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite);
+int TouchConvertToPointerEvent(const InternalEvent *ev,
+                               InternalEvent *motion,
+                               InternalEvent *button);
+int TouchGetPointerEventType(const InternalEvent *ev);
+void TouchRemovePointerGrab(DeviceIntPtr dev);
+void TouchListenerGone(XID resource);
+int TouchListenerAcceptReject(DeviceIntPtr dev,
+                              TouchPointInfoPtr ti,
+                              int listener,
+                              int mode);
+int TouchAcceptReject(ClientPtr client,
+                      DeviceIntPtr dev,
+                      int mode,
+                      uint32_t touchid,
+                      Window grab_window,
+                      XID *error);
+void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
+void TouchEmitTouchEnd(DeviceIntPtr dev,
+                       TouchPointInfoPtr ti,
+                       int flags,
+                       XID resource);
+void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
+
+/* Gesture support */
+void InitGestureEvent(InternalEvent *ievent,
+                      DeviceIntPtr dev,
+                      CARD32 ms,
+                      int type,
+                      uint16_t num_touches,
+                      uint32_t flags,
+                      double delta_x,
+                      double delta_y,
+                      double delta_unaccel_x,
+                      double delta_unaccel_y,
+                      double scale,
+                      double delta_angle);
+int GetGestureEvents(InternalEvent *events,
+                     DeviceIntPtr dev,
+                     uint16_t type,
+                     uint16_t num_touches,
+                     uint32_t flags,
+                     double delta_x,
+                     double delta_y,
+                     double delta_unaccel_x,
+                     double delta_unaccel_y,
+                     double scale,
+                     double delta_angle);
+void QueueGesturePinchEvents(DeviceIntPtr dev,
+                             uint16_t type,
+                             uint16_t num_touches,
+                             uint32_t flags,
+                             double delta_x,
+                             double delta_y,
+                             double delta_unaccel_x,
+                             double delta_unaccel_y,
+                             double scale,
+                             double delta_angle);
+void QueueGestureSwipeEvents(DeviceIntPtr dev,
+                             uint16_t type,
+                             uint16_t num_touches,
+                             uint32_t flags,
+                             double delta_x,
+                             double delta_y,
+                             double delta_unaccel_x,
+                             double delta_unaccel_y);
+Bool GestureInitGestureInfo(GestureInfoPtr gesture);
+void GestureFreeGestureInfo(GestureInfoPtr gesture);
+GestureInfoPtr GestureBeginGesture(DeviceIntPtr dev, InternalEvent *ev);
+GestureInfoPtr GestureFindActiveByEventType(DeviceIntPtr dev, int type);
+void GestureEndGesture(GestureInfoPtr gi);
+Bool GestureResourceIsOwner(GestureInfoPtr gi, XID resource);
+void GestureAddListener(GestureInfoPtr gi,
+                        XID resource,
+                        int resource_type,
+                        enum GestureListenerType type,
+                        WindowPtr window,
+                        GrabPtr grab);
+void GestureSetupListener(DeviceIntPtr dev, GestureInfoPtr gi, InternalEvent *ev);
+Bool GestureBuildSprite(DeviceIntPtr sourcedev, GestureInfoPtr gi);
+void GestureListenerGone(XID resource);
+void GestureEndActiveGestures(DeviceIntPtr dev);
+void GestureEmitGestureEndToOwner(DeviceIntPtr dev, GestureInfoPtr gi);
+void ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev);
+
+/* misc event helpers */
+void CopyPartialInternalEvent(InternalEvent* dst_event,
+                              const InternalEvent* src_event);
+Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
+Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
+Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev);
+int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type);
+void FixUpEventFromWindow(SpritePtr pSprite,
+                          xEvent *xE,
+                          WindowPtr pWin,
+                          Window child,
+                          Bool calcChild);
+Bool PointInBorderSize(WindowPtr pWin, int x, int y);
+WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
+int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
+Bool ActivatePassiveGrab(DeviceIntPtr dev,
+                         GrabPtr grab,
+                         InternalEvent *ev,
+                         InternalEvent *real_event);
+void ActivateGrabNoDelivery(DeviceIntPtr dev,
+                            GrabPtr grab,
+                            InternalEvent *event,
+                            InternalEvent *real_event);
+/**
+ * Masks specifying the type of event to deliver for an InternalEvent; used
+ * by EventIsDeliverable.
+ * @defgroup EventIsDeliverable return flags
+ * @{
+ */
+#define EVENT_XI1_MASK                (1 << 0) /**< XI1.x event */
+#define EVENT_CORE_MASK               (1 << 1) /**< Core event */
+#define EVENT_DONT_PROPAGATE_MASK     (1 << 2) /**< DontPropagate mask set */
+#define EVENT_XI2_MASK                (1 << 3) /**< XI2 mask set on window */
+/* @} */
+
+enum EventDeliveryState {
+    EVENT_DELIVERED,     /**< Event has been delivered to a client  */
+    EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */
+    EVENT_SKIP,          /**< Event can be discarded by the caller  */
+    EVENT_REJECTED,      /**< Event was rejected for delivery to the client */
+};
+
+#define VALUATOR_MODE_ALL_AXES -1
+int valuator_get_mode(DeviceIntPtr dev, int axis);
+void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
+
+/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
+   xfixes/cursor.c uses it to determine if the cursor is enabled */
+extern Bool EnableCursor;
+
+/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
+ * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
+ */
+extern Bool CursorVisible;
+
+void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
+
+Bool point_on_screen(ScreenPtr pScreen, int x, int y);
+void update_desktop_dimensions(void);
+
+void input_constrain_cursor(DeviceIntPtr pDev,
+                            ScreenPtr screen,
+                            int current_x,
+                            int current_y,
+                            int dest_x,
+                            int dest_y,
+                            int *out_x,
+                            int *out_y,
+                            int *nevents,
+                            InternalEvent* events);
+
+void InputThreadPreInit(void);
+void InputThreadInit(void);
+void InputThreadFini(void);
+
+int InputThreadRegisterDev(int fd,
+                           NotifyFdProcPtr readInputProc,
+                           void *readInputArgs);
+
+int InputThreadUnregisterDev(int fd);
+
+#endif /* _XSERVER_INPUT_PRIV_H */
diff --git a/dix/inpututils.c b/dix/inpututils.c
index 1c7e086a9..ac23ad103 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -28,10 +28,10 @@
 #endif
 
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "exglobals.h"
 #include "misc.h"
-#include "input.h"
 #include "inputstr.h"
 #include "xace.h"
 #include "xkbsrv.h"
diff --git a/dix/main.c b/dix/main.c
index 7f76e6eab..290747c90 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -78,13 +78,17 @@ Equipment Corporation.
 #include <version-config.h>
 #endif
 
+#include <pixman.h>
 #include <X11/X.h>
 #include <X11/Xos.h>            /* for unistd.h  */
 #include <X11/Xproto.h>
-#include <pixman.h>
+#include <X11/fonts/font.h>
+#include <X11/fonts/fontstruct.h>
+#include <X11/fonts/libxfont2.h>
 
 #include "dix/callback_priv.h"
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "dix/gc_priv.h"
 #include "dix/registry_priv.h"
 #include "os/audit.h"
@@ -105,9 +109,6 @@ Equipment Corporation.
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "selection.h"
-#include <X11/fonts/font.h>
-#include <X11/fonts/fontstruct.h>
-#include <X11/fonts/libxfont2.h>
 #include "servermd.h"
 #include "hotplug.h"
 #include "dixfont.h"
diff --git a/dix/touch.c b/dix/touch.c
index ef5dd4ae3..be7677485 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -31,6 +31,7 @@
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "inputstr.h"
 #include "scrnintstr.h"
diff --git a/dix/window.c b/dix/window.c
index 0de19506a..f4c8fea47 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -102,6 +102,7 @@ Equipment Corporation.
 
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 #include "os/auth.h"
 
 #include "misc.h"
@@ -111,7 +112,6 @@ Equipment Corporation.
 #include "validate.h"
 #include "windowstr.h"
 #include "propertyst.h"
-#include "input.h"
 #include "inputstr.h"
 #include "resource.h"
 #include "colormapst.h"
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index ace7bc5bd..40bfcf07f 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -27,9 +27,6 @@
 #include <dix-config.h>
 #endif
 
-#include "hostx.h"
-#include "input.h"
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -37,12 +34,15 @@
 #include <errno.h>
 #include <time.h>
 #include <err.h>
-
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <sys/time.h>
 #include <sys/mman.h>
 
+#include "dix/input_priv.h"
+
+#include "hostx.h"
+
 #define X_INCLUDE_STRING_H
 #include <X11/Xos_r.h>
 #include <X11/keysym.h>
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index e59efed4b..9f3af8fb2 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -36,10 +36,12 @@
 #include <stdio.h>
 #include <sys/file.h>           /* needed for FNONBLOCK & FASYNC */
 
-#include "xkbsrv.h"
-
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
+#include "xkbsrv.h"
 #include "XIstubs.h"            /* even though we don't use stubs.  cute, no? */
 #include "exevents.h"
 #include "extinit.h"
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 37ae26c9a..c663310d5 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -31,7 +31,10 @@
 
 #include <X11/X.h>
 #include <X11/Xmd.h>
-#include "input.h"
+#include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
+
 #include "cursor.h"
 #include "mipointer.h"
 #include "scrnintstr.h"
@@ -41,7 +44,6 @@
 #include "xf86Priv.h"
 #include "xf86_OSproc.h"
 
-#include <X11/extensions/XIproto.h>
 #include "xf86Xinput.h"
 
 #ifdef XFreeXDGA
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index c7935f071..0ce862fc9 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -57,6 +57,10 @@
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include <X11/Xatom.h>
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+
+#include "dix/input_priv.h"
 
 #include "dix/dix_priv.h"
 
@@ -72,11 +76,8 @@
 #include "dgaproc_priv.h"
 #endif
 
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
 #include "inputstr.h"
 #include "xf86Xinput.h"
-
 #include "mi.h"
 #include "mipointer.h"
 
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index ec785cb67..1e7a375c8 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -42,6 +42,7 @@
 #include <X11/X.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 
 #include "mi.h"
 #include "os.h"
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 073a81bf3..1a4da4eb8 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -50,12 +50,12 @@
 #include <X11/Xatom.h>
 
 #include "config/dbus-core.h"
+#include "dix/input_priv.h"
 #include "dix/screenint_priv.h"
 #include "os/cmdline.h"
 #include "os/ddx_priv.h"
 #include "os/osdep.h"
 
-#include "input.h"
 #include "servermd.h"
 #include "windowstr.h"
 #include "scrnintstr.h"
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index 08f656b30..5014f213e 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -26,6 +26,9 @@
 #endif
 
 #include <X11/X.h>
+
+#include "dix/input_priv.h"
+
 #include "os.h"
 #include "globals.h"
 #include "xf86.h"
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 0c9b97335..0d1dd8b6d 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -59,6 +59,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/ptrveloc_priv.h"
+#include "dix/input_priv.h"
 
 #include "xf86.h"
 #include "xf86Priv.h"
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 7943c02b8..695f42219 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -24,6 +24,9 @@
 #include <xorg-config.h>
 #endif
 
+#include <X11/extensions/render.h>
+
+#include "dix/input_priv.h"
 #include "dix/screenint_priv.h"
 
 #include "xf86.h"
@@ -36,7 +39,6 @@
 #include "windowstr.h"
 #include "inputstr.h"
 #include "randrstr_priv.h"
-#include <X11/extensions/render.h>
 
 #include "xf86cmap.h"
 #include "xf86Crtc.h"
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 76b20f198..7f1c2619a 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -31,6 +31,7 @@
 
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include <inputstr.h>
 #include <xkbsrv.h>
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index e77cc4305..7300af48a 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -30,6 +30,7 @@
 #include <X11/Xatom.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "randr/randrstr_priv.h"
 
 #include "xwayland-cvt.h"
diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c
index 8198c8ee9..14b7a515a 100644
--- a/hw/xwayland/xwayland-screen.c
+++ b/hw/xwayland/xwayland-screen.c
@@ -37,6 +37,7 @@
 #include <X11/Xatom.h>
 #include <X11/Xfuncproto.h>
 
+#include "dix/input_priv.h"
 #include "os/osdep.h"
 #include "os/xserver_poll.h"
 
diff --git a/hw/xwayland/xwayland-xtest.c b/hw/xwayland/xwayland-xtest.c
index d8b0e018c..5541fecef 100644
--- a/hw/xwayland/xwayland-xtest.c
+++ b/hw/xwayland/xwayland-xtest.c
@@ -31,6 +31,7 @@
 #include <libei.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 
 #include <inputstr.h>
 #include <inpututils.h>
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index ed505e47d..b9cffd8d7 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -37,6 +37,8 @@
 #include <../xfree86/common/xorgVersion.h>
 #include "win.h"
 
+#include "dix/input_priv.h"
+
 void
 OsVendorVErrorF(const char *pszFormat, va_list va_args)
 {
diff --git a/include/input.h b/include/input.h
index fd5b7c4df..de89ee37d 100644
--- a/include/input.h
+++ b/include/input.h
@@ -288,9 +288,6 @@ extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
 extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
 extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type);
 
-extern void InitCoreDevices(void);
-extern void InitXTestDevices(void);
-
 extern _X_EXPORT DeviceIntPtr AddInputDevice(ClientPtr /*client */ ,
                                              DeviceProc /*deviceProc */ ,
                                              Bool /*autoStart */ );
@@ -303,13 +300,6 @@ extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
 
 extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
                                     BOOL /* sendevent */ );
-extern void DisableAllDevices(void);
-extern int InitAndStartDevices(void);
-
-extern void CloseDownDevices(void);
-extern void AbortDevices(void);
-
-extern void UndisplayDevices(void);
 
 extern _X_EXPORT int RemoveDevice(DeviceIntPtr /*dev */ ,
                                   BOOL /* sendevent */ );
@@ -329,11 +319,6 @@ extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
                                                   Atom * /* labels */ ,
                                                   CARD8 * /*map */ );
 
-extern _X_INTERNAL ValuatorClassPtr AllocValuatorClass(ValuatorClassPtr src,
-                                                       int numAxes);
-extern _X_INTERNAL void FreeDeviceClass(int type, void **class);
-
-
 extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ ,
                                                     int /*numAxes */ ,
                                                     Atom * /* labels */ ,
@@ -430,30 +415,6 @@ extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev,
 							 BellProcPtr bell_func,
 							 KbdCtrlProcPtr ctrl_func);
 
-extern int ApplyPointerMapping(DeviceIntPtr /* pDev */ ,
-                               CARD8 * /* map */ ,
-                               int /* len */ ,
-                               ClientPtr /* client */ );
-
-extern Bool BadDeviceMap(BYTE * /*buff */ ,
-                         int /*length */ ,
-                         unsigned /*low */ ,
-                         unsigned /*high */ ,
-                         XID * /*errval */ );
-
-extern void NoteLedState(DeviceIntPtr /*keybd */ ,
-                         int /*led */ ,
-                         Bool /*on */ );
-
-extern void MaybeStopHint(DeviceIntPtr /*device */ ,
-                          ClientPtr /*client */ );
-
-extern void ProcessPointerEvent(InternalEvent * /* ev */ ,
-                                DeviceIntPtr /*mouse */ );
-
-extern void ProcessKeyboardEvent(InternalEvent * /*ev */ ,
-                                 DeviceIntPtr /*keybd */ );
-
 extern _X_EXPORT void ProcessInputEvents(void);
 
 extern _X_EXPORT void InitInput(int /*argc */ ,
@@ -465,14 +426,6 @@ extern _X_EXPORT int GetMaximumEventsNum(void);
 extern _X_EXPORT InternalEvent *InitEventList(int num_events);
 extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
 
-extern void CreateClassesChangedEvent(InternalEvent *event,
-                                      DeviceIntPtr master,
-                                      DeviceIntPtr slave, int flags);
-
-extern InternalEvent *UpdateFromMaster(InternalEvent *events,
-                                       DeviceIntPtr pDev,
-                                       int type, int *num_events);
-
 extern _X_EXPORT int GetPointerEvents(InternalEvent *events,
                                       DeviceIntPtr pDev,
                                       int type,
@@ -493,54 +446,6 @@ extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
                                           int type,
                                           int key_code);
 
-extern int GetTouchEvents(InternalEvent *events,
-                          DeviceIntPtr pDev,
-                          uint32_t ddx_touchid,
-                          uint16_t type,
-                          uint32_t flags, const ValuatorMask *mask);
-
-void QueueTouchEvents(DeviceIntPtr device,
-                      int type,
-                      uint32_t ddx_touchid,
-                      int flags, const ValuatorMask *mask);
-
-void InitGestureEvent(InternalEvent *ievent, DeviceIntPtr dev, CARD32 ms,
-                      int type, uint16_t num_touches, uint32_t flags,
-                      double delta_x, double delta_y,
-                      double delta_unaccel_x, double delta_unaccel_y,
-                      double scale, double delta_angle);
-
-int GetGestureEvents(InternalEvent *events, DeviceIntPtr dev,
-                     uint16_t type, uint16_t num_touches, uint32_t flags,
-                     double delta_x, double delta_y,
-                     double delta_unaccel_x,
-                     double delta_unaccel_y,
-                     double scale, double delta_angle);
-
-
-void QueueGesturePinchEvents(DeviceIntPtr dev, uint16_t type,
-                             uint16_t num_touches, uint32_t flags,
-                             double delta_x, double delta_y,
-                             double delta_unaccel_x,
-                             double delta_unaccel_y,
-                             double scale, double delta_angle);
-
-void QueueGestureSwipeEvents(DeviceIntPtr dev, uint16_t type,
-                             uint16_t num_touches, uint32_t flags,
-                             double delta_x, double delta_y,
-                             double delta_unaccel_x,
-                             double delta_unaccel_y);
-
-extern int GetTouchOwnershipEvents(InternalEvent *events,
-                                   DeviceIntPtr pDev,
-                                   TouchPointInfoPtr ti,
-                                   uint8_t mode, XID resource, uint32_t flags);
-
-extern void GetDixTouchEnd(InternalEvent *ievent,
-                           DeviceIntPtr dev,
-                           TouchPointInfoPtr ti,
-                           uint32_t flags);
-
 extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
                                         DeviceIntPtr pDev,
                                         int type, const ValuatorMask *mask);
@@ -548,12 +453,6 @@ extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
 extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
                                            int type, const ValuatorMask *mask);
 
-#ifdef PANORAMIX
-_X_EXPORT
-#endif
-extern void PostSyntheticMotion(DeviceIntPtr pDev,
-                                int x, int y, int screen, unsigned long time);
-
 extern _X_EXPORT int GetMotionHistorySize(void);
 
 extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev);
@@ -564,11 +463,6 @@ extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev,
                                       unsigned long stop,
                                       ScreenPtr pScreen, BOOL core);
 
-extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
-
-extern int AttachDevice(ClientPtr client,
-                        DeviceIntPtr slave, DeviceIntPtr master);
-
 extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
 extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
 
@@ -578,25 +472,11 @@ extern _X_EXPORT int AllocDevicePair(ClientPtr client,
                                      DeviceIntPtr *keybd,
                                      DeviceProc ptr_proc,
                                      DeviceProc keybd_proc, Bool master);
-extern void DeepCopyDeviceClasses(DeviceIntPtr from,
-                                  DeviceIntPtr to, DeviceChangedEvent *dce);
 
 /* Helper functions. */
 extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
                                         KeyCode **modkeymap,
                                         int *max_keys_per_mod);
-extern int change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *map,
-                         int max_keys_per_mod);
-extern int AllocXTestDevice(ClientPtr client, const char *name,
-                            DeviceIntPtr *ptr, DeviceIntPtr *keybd,
-                            DeviceIntPtr master_ptr, DeviceIntPtr master_keybd);
-extern BOOL IsXTestDevice(DeviceIntPtr dev, DeviceIntPtr master);
-extern DeviceIntPtr GetXTestDevice(DeviceIntPtr master);
-extern void SendDevicePresenceEvent(int deviceid, int type);
-extern void DeliverDeviceClassesChangedEvent(int sourceid, Time time);
-extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
-                                                           attrs);
-extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
 
 enum TouchListenerState {
     TOUCH_LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
@@ -622,103 +502,10 @@ enum GestureListenerType {
     GESTURE_LISTENER_REGULAR
 };
 
-extern void TouchInitDDXTouchPoint(DeviceIntPtr dev,
-                                   DDXTouchPointInfoPtr ddxtouch);
-extern DDXTouchPointInfoPtr TouchBeginDDXTouch(DeviceIntPtr dev,
-                                               uint32_t ddx_id);
-extern void TouchEndDDXTouch(DeviceIntPtr dev, DDXTouchPointInfoPtr ti);
-extern DDXTouchPointInfoPtr TouchFindByDDXID(DeviceIntPtr dev,
-                                             uint32_t ddx_id, Bool create);
-extern Bool TouchInitTouchPoint(TouchClassPtr touch, ValuatorClassPtr v,
-                                int index);
-extern void TouchFreeTouchPoint(DeviceIntPtr dev, int index);
-extern TouchPointInfoPtr TouchBeginTouch(DeviceIntPtr dev, int sourceid,
-                                         uint32_t touchid,
-                                         Bool emulate_pointer);
-extern TouchPointInfoPtr TouchFindByClientID(DeviceIntPtr dev,
-                                             uint32_t client_id);
-extern void TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti);
-extern Bool TouchEventHistoryAllocate(TouchPointInfoPtr ti);
-extern void TouchEventHistoryFree(TouchPointInfoPtr ti);
-extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
-extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev,
-                                    XID resource);
-extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
-extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type,
-                             enum InputLevel level, enum TouchListenerType type,
-                             enum TouchListenerState state, WindowPtr window, GrabPtr grab);
-extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
-extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti,
-                                InternalEvent *ev);
-extern Bool TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
-                             InternalEvent *ev);
-extern Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite);
-extern int TouchConvertToPointerEvent(const InternalEvent *ev,
-                                      InternalEvent *motion,
-                                      InternalEvent *button);
-extern int TouchGetPointerEventType(const InternalEvent *ev);
-extern void TouchRemovePointerGrab(DeviceIntPtr dev);
-extern void TouchListenerGone(XID resource);
-extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti,
-                                     int listener, int mode);
-extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
-                             uint32_t touchid, Window grab_window, XID *error);
-extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev);
-extern void TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource);
-extern void TouchAcceptAndEnd(DeviceIntPtr dev, int touchid);
-
-extern Bool GestureInitGestureInfo(GestureInfoPtr gesture);
-extern void GestureFreeGestureInfo(GestureInfoPtr gesture);
-extern GestureInfoPtr GestureBeginGesture(DeviceIntPtr dev, InternalEvent *ev);
-extern GestureInfoPtr GestureFindActiveByEventType(DeviceIntPtr dev, int type);
-extern void GestureEndGesture(GestureInfoPtr gi);
-extern Bool GestureResourceIsOwner(GestureInfoPtr gi, XID resource);
-extern void GestureAddListener(GestureInfoPtr gi, XID resource, int resource_type,
-                               enum GestureListenerType type,
-                               WindowPtr window, GrabPtr grab);
-extern void GestureSetupListener(DeviceIntPtr dev, GestureInfoPtr gi,
-                                 InternalEvent *ev);
-extern Bool GestureBuildSprite(DeviceIntPtr sourcedev, GestureInfoPtr gi);
-extern void GestureListenerGone(XID resource);
-extern void GestureEndActiveGestures(DeviceIntPtr dev);
-extern void GestureEmitGestureEndToOwner(DeviceIntPtr dev, GestureInfoPtr gi);
-extern void ProcessGestureEvent(InternalEvent *ev, DeviceIntPtr dev);
-
-/* misc event helpers */
-extern void CopyPartialInternalEvent(InternalEvent* dst_event, const InternalEvent* src_event);
-extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients);
-extern Mask GetEventFilter(DeviceIntPtr dev, xEvent *event);
-extern Bool WindowXI2MaskIsset(DeviceIntPtr dev, WindowPtr win, xEvent *ev);
-extern int GetXI2MaskByte(XI2Mask *mask, DeviceIntPtr dev, int event_type);
-void FixUpEventFromWindow(SpritePtr pSprite,
-                          xEvent *xE,
-                          WindowPtr pWin, Window child, Bool calcChild);
-extern Bool PointInBorderSize(WindowPtr pWin, int x, int y);
-extern WindowPtr XYToWindow(SpritePtr pSprite, int x, int y);
-extern int EventIsDeliverable(DeviceIntPtr dev, int evtype, WindowPtr win);
-extern Bool ActivatePassiveGrab(DeviceIntPtr dev, GrabPtr grab,
-                                InternalEvent *ev, InternalEvent *real_event);
-extern void ActivateGrabNoDelivery(DeviceIntPtr dev, GrabPtr grab,
-                                   InternalEvent *event,
-                                   InternalEvent *real_event);
-/**
- * Masks specifying the type of event to deliver for an InternalEvent; used
- * by EventIsDeliverable.
- * @defgroup EventIsDeliverable return flags
- * @{
- */
-#define EVENT_XI1_MASK                (1 << 0) /**< XI1.x event */
-#define EVENT_CORE_MASK               (1 << 1) /**< Core event */
-#define EVENT_DONT_PROPAGATE_MASK     (1 << 2) /**< DontPropagate mask set */
-#define EVENT_XI2_MASK                (1 << 3) /**< XI2 mask set on window */
-/* @} */
-
-enum EventDeliveryState {
-    EVENT_DELIVERED,     /**< Event has been delivered to a client  */
-    EVENT_NOT_DELIVERED, /**< Event was not delivered to any client */
-    EVENT_SKIP,          /**< Event can be discarded by the caller  */
-    EVENT_REJECTED,      /**< Event was rejected for delivery to the client */
-};
+extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
+                                                           attrs);
+
+extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
 
 /* Implemented by the DDX. */
 extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
@@ -726,22 +513,7 @@ extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
                                            DeviceIntPtr *dev);
 extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev);
 extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info);
-
 extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration);
-
-#define VALUATOR_MODE_ALL_AXES -1
-extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
-extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
-
-/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
-   xfixes/cursor.c uses it to determine if the cursor is enabled */
-extern Bool EnableCursor;
-
-/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
- * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
- */
-extern Bool CursorVisible;
-
 extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
 extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
 extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
@@ -783,8 +555,6 @@ extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask
                                                         int valuator,
                                                         double *accel,
                                                         double *unaccel);
-extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask);
-
 /* InputOption handling interface */
 extern _X_EXPORT InputOption *input_option_new(InputOption *list,
                                                const char *key,
@@ -800,30 +570,11 @@ extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key);
 extern _X_EXPORT void input_option_set_value(InputOption *opt,
                                              const char *value);
 
-extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
-extern _X_HIDDEN void update_desktop_dimensions(void);
-
-extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen,
-                                             int current_x, int current_y,
-                                             int dest_x, int dest_y,
-                                             int *out_x, int *out_y,
-                                             int *nevents, InternalEvent* events);
-
 extern _X_EXPORT void input_lock(void);
 extern _X_EXPORT void input_unlock(void);
 extern _X_EXPORT void input_force_unlock(void);
 extern _X_EXPORT int in_input_thread(void);
 
-extern void InputThreadPreInit(void);
-extern void InputThreadInit(void);
-extern void InputThreadFini(void);
-
-extern int InputThreadRegisterDev(int fd,
-                                  NotifyFdProcPtr readInputProc,
-                                  void *readInputArgs);
-
-extern int InputThreadUnregisterDev(int fd);
-
 extern _X_EXPORT Bool InputThreadEnable;
 
 #endif                          /* INPUT_H */
diff --git a/mi/mipointer.c b/mi/mipointer.c
index e330cc122..48489dc84 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -55,6 +55,7 @@ in this Software without prior written authorization from The Open Group.
 #include   <X11/Xproto.h>
 
 #include   "dix/dix_priv.h"
+#include   "dix/input_priv.h"
 
 #include   "misc.h"
 #include   "windowstr.h"
diff --git a/mi/miwindow.c b/mi/miwindow.c
index dfdb0701e..68520ae6c 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -50,6 +50,9 @@ SOFTWARE.
 
 #include <X11/X.h>
 #include <X11/extensions/shapeconst.h>
+
+#include "dix/input_priv.h"
+
 #include "regionstr.h"
 #include "region.h"
 #include "mi.h"
diff --git a/miext/sync/misyncfd.c b/miext/sync/misyncfd.c
index 42a75024d..917931168 100644
--- a/miext/sync/misyncfd.c
+++ b/miext/sync/misyncfd.c
@@ -24,6 +24,8 @@
 #include <dix-config.h>
 #endif
 
+#include "dix/input_priv.h"
+
 #include "scrnintstr.h"
 #include "misync_priv.h"
 #include "misyncstr.h"
diff --git a/os/inputthread.c b/os/inputthread.c
index 07f192c40..132940f98 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <pthread.h>
 
+#include "dix/input_priv.h"
 #include "os/ddx_priv.h"
 
 #include "inputstr.h"
diff --git a/os/log.c b/os/log.c
index 10d95ce11..dfb226145 100644
--- a/os/log.c
+++ b/os/log.c
@@ -89,12 +89,12 @@ OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/Xos.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "os/audit.h"
 #include "os/ddx_priv.h"
 #include "os/fmt.h"
 #include "os/osdep.h"
 
-#include "input.h"
 #include "opaque.h"
 
 #ifdef WIN32
diff --git a/os/utils.c b/os/utils.c
index ac18110cf..4fb7de469 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -106,6 +106,7 @@ __stdcall unsigned long GetTickCount(void);
 #endif
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "os/auth.h"
 #include "os/cmdline.h"
 #include "os/ddx_priv.h"
diff --git a/test/input.c b/test/input.c
index 7c18ae609..dffde3555 100644
--- a/test/input.c
+++ b/test/input.c
@@ -37,6 +37,7 @@
 #include "dix/dix_priv.h"
 #include "dix/eventconvert.h"
 #include "dix/exevents_priv.h"
+#include "dix/input_priv.h"
 
 #include "misc.h"
 #include "resource.h"
diff --git a/test/misc.c b/test/misc.c
index ba7a80b51..5bf719312 100644
--- a/test/misc.c
+++ b/test/misc.c
@@ -29,11 +29,13 @@
 #endif
 
 #include <stdint.h>
+
+#include "dix/input_priv.h"
+
 #include "misc.h"
 #include "scrnintstr.h"
 #include "dix.h"
 #include "dixstruct.h"
-
 #include "tests-common.h"
 
 static void
diff --git a/test/touch.c b/test/touch.c
index dcd693326..86dcc32de 100644
--- a/test/touch.c
+++ b/test/touch.c
@@ -29,10 +29,12 @@
 #endif
 
 #include <stdint.h>
+
+#include "dix/input_priv.h"
+
 #include "inputstr.h"
 #include "assert.h"
 #include "scrnintstr.h"
-
 #include "tests-common.h"
 
 static void
diff --git a/test/xtest.c b/test/xtest.c
index 1dc7078b1..f37863cd8 100644
--- a/test/xtest.c
+++ b/test/xtest.c
@@ -27,10 +27,12 @@
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
+
 #include <stdint.h>
 #include <X11/Xatom.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 
 #include "input.h"
 #include "inputstr.h"
@@ -41,7 +43,6 @@
 #include "xkbsrv.h"
 #include "xserver-properties.h"
 #include "syncsrv.h"
-
 #include "tests-common.h"
 
 /**
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index fffcf31f5..854dde221 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -38,6 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/keysym.h>
 #include <X11/extensions/XIproto.h>
 
+#include "dix/input_priv.h"
 #include "xkb/xkbsrv_priv.h"
 
 #include "exglobals.h"
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 99bb6574e..bbae03b51 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/keysym.h>
 
 #include "dix/dix_priv.h"
+#include "dix/input_priv.h"
 #include "xkb/xkbsrv_priv.h"
 
 #include "misc.h"
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
index 972f35170..903534d54 100644
--- a/xkb/xkbPrKeyEv.c
+++ b/xkb/xkbPrKeyEv.c
@@ -35,6 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/Xproto.h>
 #include <X11/keysym.h>
 
+#include "dix/input_priv.h"
 #include "xkb/xkbsrv_priv.h"
 
 #include "misc.h"


More information about the xorg-commit mailing list