xserver: Branch 'master' - 7 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Mar 9 18:05:03 UTC 2024


 dix/devices.c                  |    3 ++
 dix/ptrveloc.c                 |   26 +++++++++---------
 dix/ptrveloc_priv.h            |   58 +++++++++++++++++++++++++++++++++++++++++
 hw/xfree86/common/xf86Xinput.c |    3 ++
 include/ptrveloc.h             |   55 --------------------------------------
 5 files changed, 79 insertions(+), 66 deletions(-)

New commits:
commit 2a5e7542755c8b6d1ce046cf92cfc76594d3a86d
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 20:01:19 2024 +0100

    dix: unexport SetAccelerationProfile()
    
    Not used by any module, just locally within one source file, thus
    unexport and make it static
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 200cd48c2..5166288e8 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -92,6 +92,8 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
 /* some int which is not a profile number */
 #define PROFILE_UNINITIALIZE (-100)
 
+static int SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
+
 /**
  * Init DeviceVelocity struct so it should match the average case
  */
@@ -1012,8 +1014,7 @@ GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num)
  *
  * returns FALSE if profile number is unavailable, TRUE otherwise.
  */
-int
-SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num)
+static int SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num)
 {
     PointerAccelerationProfileFunc profile;
 
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 9ff2dfa06..6a22581b1 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,9 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT int
-SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
-
 extern _X_EXPORT DeviceVelocityPtr
 GetDevicePredictableAccelData(DeviceIntPtr dev);
 
commit 1b983d7e82b4c3ffd4ba520feca183de857cfa6d
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:57:59 2024 +0100

    dix: unexport FreeVelocityData()
    
    Only used within one source, not used by external modules, thus unexport
    and make it static.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 82a55d410..200cd48c2 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -115,8 +115,7 @@ static void InitVelocityData(DeviceVelocityPtr vel)
 /**
  * Clean up DeviceVelocityRec
  */
-void
-FreeVelocityData(DeviceVelocityPtr vel)
+static void FreeVelocityData(DeviceVelocityPtr vel)
 {
     free(vel->tracker);
     SetAccelerationProfile(vel, PROFILE_UNINITIALIZE);
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index cd3a3293c..9ff2dfa06 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,9 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT void
-FreeVelocityData(DeviceVelocityPtr vel);
-
 extern _X_EXPORT int
 SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
 
commit 9d3766080b9596d8012b462c3d7fd69bd9bab538
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:55:58 2024 +0100

    dix: unexport BasicComputeAcceleration()
    
    only used locally within one source file, so unexport and make it static.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index a79a83eee..82a55d410 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -749,10 +749,11 @@ ApplyConstantDeceleration(DeviceVelocityPtr vel, double *fdx, double *fdy)
 /*
  * compute the acceleration for given velocity and enforce min_acceleration
  */
-double
-BasicComputeAcceleration(DeviceIntPtr dev,
-                         DeviceVelocityPtr vel,
-                         double velocity, double threshold, double acc)
+static double BasicComputeAcceleration(DeviceIntPtr dev,
+                                       DeviceVelocityPtr vel,
+                                       double velocity,
+                                       double threshold,
+                                       double acc)
 {
 
     double result;
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 024123ba5..cd3a3293c 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,10 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT double
-BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
-                         double velocity, double threshold, double acc);
-
 extern _X_EXPORT void
 FreeVelocityData(DeviceVelocityPtr vel);
 
commit a09f2540d214b0ba6257d135b57831053badbc0f
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:50:08 2024 +0100

    dix: unexport ProcessVelocityData2D()
    
    Only used with on source file, so unexport and make it static.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 1245b7bfa..a79a83eee 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -690,8 +690,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t)
  * Perform velocity approximation based on 2D 'mickeys' (mouse motion delta).
  * return true if non-visible state reset is suggested
  */
-BOOL
-ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time)
+static BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time)
 {
     double velocity;
 
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index aa46c0191..024123ba5 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,9 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT BOOL
-ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time);
-
 extern _X_EXPORT double
 BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
                          double velocity, double threshold, double acc);
commit b598727f1c7abecef4a4d41f4534d9027af912f5
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:47:29 2024 +0100

    dix: unexport InitTrackers()
    
    Not used by any modules, thus no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc_priv.h b/dix/ptrveloc_priv.h
index a4118cf65..a96401b90 100644
--- a/dix/ptrveloc_priv.h
+++ b/dix/ptrveloc_priv.h
@@ -53,4 +53,6 @@ void acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val,
 void acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val,
                                   CARD32 evtime);
 
+void InitTrackers(DeviceVelocityPtr vel, int ntracker);
+
 #endif /* _XSERVER_POINTERVELOCITY_PRIV_H */
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 245db5776..8091a2450 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -55,6 +55,9 @@
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 #include <X11/Xatom.h>
+
+#include "dix/ptrveloc_priv.h"
+
 #include "xf86.h"
 #include "xf86Priv.h"
 #include "xf86Config.h"
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 1280978bd..aa46c0191 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,9 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT void
-InitTrackers(DeviceVelocityPtr vel, int ntracker);
-
 extern _X_EXPORT BOOL
 ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time);
 
commit 4db1f3f76013b0797e480e65c2bdf2db0acaf8f4
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:43:30 2024 +0100

    dix: unexport InitVelocityData()
    
    Not used by any modules, not even outside the source file, thus
    no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index fce97c3fe..1245b7bfa 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -95,8 +95,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
 /**
  * Init DeviceVelocity struct so it should match the average case
  */
-void
-InitVelocityData(DeviceVelocityPtr vel)
+static void InitVelocityData(DeviceVelocityPtr vel)
 {
     memset(vel, 0, sizeof(DeviceVelocityRec));
 
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index a99416ee7..1280978bd 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -81,9 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-extern _X_EXPORT void
-InitVelocityData(DeviceVelocityPtr vel);
-
 extern _X_EXPORT void
 InitTrackers(DeviceVelocityPtr vel, int ntracker);
 
commit a3ebe4fa4184d801348a4f53e4832d55a7455ceb
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 19:40:14 2024 +0100

    dix: move non-exported ptrveloc functions to separate header
    
    unclutter ptrveloc.h by moving non-exported declarations into their own
    private header file.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1347>

diff --git a/dix/devices.c b/dix/devices.c
index 84a6406d1..0011be77c 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -49,6 +49,9 @@ SOFTWARE.
 #endif
 
 #include <X11/X.h>
+
+#include "dix/ptrveloc_priv.h"
+
 #include "misc.h"
 #include "resource.h"
 #include <X11/Xproto.h>
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 632971ed9..fce97c3fe 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -27,6 +27,9 @@
 #endif
 
 #include <math.h>
+
+#include "dix/ptrveloc_priv.h"
+
 #include <ptrveloc.h>
 #include <exevents.h>
 #include <X11/Xatom.h>
diff --git a/dix/ptrveloc_priv.h b/dix/ptrveloc_priv.h
new file mode 100644
index 000000000..a4118cf65
--- /dev/null
+++ b/dix/ptrveloc_priv.h
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: MIT OR X11
+ *
+ * Copyright © 2024 Enrico Weigelt, metux IT consult <info at metux.net>
+ * Copyright © 2006-2011 Simon Thum             simon dot thum at gmx dot de
+ */
+#ifndef _XSERVER_POINTERVELOCITY_PRIV_H
+#define _XSERVER_POINTERVELOCITY_PRIV_H
+
+#include <input.h>
+
+#include "ptrveloc.h"
+
+/* fwd */
+struct _DeviceVelocityRec;
+
+/**
+ * profile
+ * returns actual acceleration depending on velocity, acceleration control,...
+ */
+typedef double (*PointerAccelerationProfileFunc)
+ (DeviceIntPtr dev, struct _DeviceVelocityRec * vel,
+  double velocity, double threshold, double accelCoeff);
+
+/**
+ * a motion history, with just enough information to
+ * calc mean velocity and decide which motion was along
+ * a more or less straight line
+ */
+typedef struct _MotionTracker {
+    double dx, dy;              /* accumulated delta for each axis */
+    int time;                   /* time of creation */
+    int dir;                    /* initial direction bitfield */
+} MotionTracker, *MotionTrackerPtr;
+
+/**
+ * contains the run-time data for the predictable scheme, that is, a
+ * DeviceVelocityPtr and the property handlers.
+ */
+typedef struct _PredictableAccelSchemeRec {
+    DeviceVelocityPtr vel;
+    long *prop_handlers;
+    int num_prop_handlers;
+} PredictableAccelSchemeRec, *PredictableAccelSchemePtr;
+
+void AccelerationDefaultCleanup(DeviceIntPtr dev);
+
+Bool InitPredictableAccelerationScheme(DeviceIntPtr dev,
+                                       struct _ValuatorAccelerationRec *protoScheme);
+
+void acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val,
+                                  CARD32 evtime);
+
+void acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val,
+                                  CARD32 evtime);
+
+#endif /* _XSERVER_POINTERVELOCITY_PRIV_H */
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 3bd982a90..a99416ee7 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -51,16 +51,7 @@ typedef double (*PointerAccelerationProfileFunc)
  (DeviceIntPtr dev, struct _DeviceVelocityRec * vel,
   double velocity, double threshold, double accelCoeff);
 
-/**
- * a motion history, with just enough information to
- * calc mean velocity and decide which motion was along
- * a more or less straight line
- */
-typedef struct _MotionTracker {
-    double dx, dy;              /* accumulated delta for each axis */
-    int time;                   /* time of creation */
-    int dir;                    /* initial direction bitfield */
-} MotionTracker, *MotionTrackerPtr;
+typedef struct _MotionTracker MotionTracker, *MotionTrackerPtr;
 
 /**
  * Contains all data needed to implement mouse ballistics
@@ -90,16 +81,6 @@ typedef struct _DeviceVelocityRec {
     } statistics;
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-/**
- * contains the run-time data for the predictable scheme, that is, a
- * DeviceVelocityPtr and the property handlers.
- */
-typedef struct _PredictableAccelSchemeRec {
-    DeviceVelocityPtr vel;
-    long *prop_handlers;
-    int num_prop_handlers;
-} PredictableAccelSchemeRec, *PredictableAccelSchemePtr;
-
 extern _X_EXPORT void
 InitVelocityData(DeviceVelocityPtr vel);
 
@@ -126,19 +107,4 @@ extern _X_EXPORT void
 SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
                                      PointerAccelerationProfileFunc profile);
 
-extern _X_INTERNAL void
-AccelerationDefaultCleanup(DeviceIntPtr dev);
-
-extern _X_INTERNAL Bool
-InitPredictableAccelerationScheme(DeviceIntPtr dev,
-                                  struct _ValuatorAccelerationRec *protoScheme);
-
-extern _X_INTERNAL void
-acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val,
-                             CARD32 evtime);
-
-extern _X_INTERNAL void
-acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val,
-                             CARD32 evtime);
-
 #endif                          /* POINTERVELOCITY_H */


More information about the xorg-commit mailing list